diff options
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r-- | src/rail_cmd.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index a0fd968cc..60697b636 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -531,7 +531,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u /* ...but tram is not required. */ uint num_new_tram_pieces = (tram != ROAD_NONE) ? 2 - CountBits(tram) : 0; - cost.AddCost((num_new_road_pieces + num_new_tram_pieces) * _price[PR_BUILD_ROAD]); + cost.AddCost((num_new_road_pieces + num_new_tram_pieces) * _price[PR_BUILD_ROAD] * UNDERGROUND_COST_MULTIPLIER(tile)); if (flags & DC_EXEC) { MakeRoadCrossing(tile, road_owner, tram_owner, _current_company, (track == TRACK_X ? AXIS_Y : AXIS_X), railtype, roadtypes, GetTownIndex(tile)); @@ -590,7 +590,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u YapfNotifyTrackLayoutChange(tile, track); } - cost.AddCost(RailBuildCost(railtype)); + cost.AddCost(RailBuildCost(railtype) * UNDERGROUND_COST_MULTIPLIER(tile)); return cost; } @@ -634,7 +634,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, if (ret.Failed()) return ret; } - cost.AddCost(RailClearCost(GetRailType(tile))); + cost.AddCost(RailClearCost(GetRailType(tile)) * UNDERGROUND_COST_MULTIPLIER(tile)); if (flags & DC_EXEC) { if (HasReservedTracks(tile, trackbit)) { @@ -667,7 +667,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, if ((present & trackbit) == 0) return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK); if (present == (TRACK_BIT_X | TRACK_BIT_Y)) crossing = true; - cost.AddCost(RailClearCost(GetRailType(tile))); + cost.AddCost(RailClearCost(GetRailType(tile)) * UNDERGROUND_COST_MULTIPLIER(tile)); /* Charge extra to remove signals on the track, if they are there */ if (HasSignalOnTrack(tile, track)) { @@ -980,7 +980,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (!_settings_game.construction.build_on_slopes || !CanBuildDepotByTileh(dir, tileh)) { return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); } - cost.AddCost(_price[PR_BUILD_FOUNDATION]); + cost.AddCost(_price[PR_BUILD_FOUNDATION] * UNDERGROUND_COST_MULTIPLIER(tile)); } cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR)); @@ -1005,8 +1005,8 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u YapfNotifyTrackLayoutChange(tile, DiagDirToDiagTrack(dir)); } - cost.AddCost(_price[PR_BUILD_DEPOT_TRAIN]); - cost.AddCost(RailBuildCost(railtype)); + cost.AddCost(_price[PR_BUILD_DEPOT_TRAIN] * UNDERGROUND_COST_MULTIPLIER(tile)); + cost.AddCost(RailBuildCost(railtype) * UNDERGROUND_COST_MULTIPLIER(tile)); return cost; } @@ -1656,7 +1656,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 InvalidateWindowData(WC_VEHICLE_DEPOT, tile); InvalidateWindowData(WC_BUILD_VEHICLE, tile); } - cost.AddCost(RailConvertCost(type, totype)); + cost.AddCost(RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile)); break; default: // RAIL_TILE_NORMAL, RAIL_TILE_SIGNALS @@ -1667,7 +1667,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 YapfNotifyTrackLayoutChange(tile, RemoveFirstTrack(&tracks)); } } - cost.AddCost(RailConvertCost(type, totype) * CountBits(GetTrackBits(tile))); + cost.AddCost(RailConvertCost(type, totype) * CountBits(GetTrackBits(tile)) * UNDERGROUND_COST_MULTIPLIER(tile)); break; } break; @@ -1729,7 +1729,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 } } - cost.AddCost((GetTunnelBridgeLength(tile, endtile) + 2) * RailConvertCost(type, totype)); + cost.AddCost((GetTunnelBridgeLength(tile, endtile) + 2) * RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile)); break; } @@ -1739,7 +1739,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 YapfNotifyTrackLayoutChange(tile, track); } - cost.AddCost(RailConvertCost(type, totype)); + cost.AddCost(RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile)); break; } |