Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Get the aqueduct that can be build from the
- * current tile. Aqueducts are only build on sloped tiles.
- */
- function Canal::_GetAqueduct(last_node, cur_node, aqueduct_dir)
- {
- if (!this._IsInclinedTile(cur_node)) return [];
- for (local i = 1; i < this._max_aqueduct_length; i++) {
- local next_tile = cur_node + i * (cur_node - last_node);
- if (!AIMap.IsValidTile(next_tile)) {
- return [];
- }
- if (AIBridge.BuildBridge(AIVehicle.VT_WATER, 0, cur_node, next_tile)) {
- return [next_tile, aqueduct_dir, AITileList()];
- }
- }
- return [];
- }
- function Canal::_IsInclinedTile(tile)
- {
- local slope = AITile.GetSlope(tile);
- return slope == AITile.SLOPE_SW || slope == AITile.SLOPE_NW || slope == AITile.SLOPE_SE || slope == AITile.SLOPE_NE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement