summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-05 22:43:31 +0100
committerErich Eckner <git@eckner.net>2022-01-16 21:58:15 +0100
commit795c8b2f9c2d5b6a7ccf0504f62d8426a8bc79ec (patch)
tree41abe6fdc04cd8f12f6309891a373fefe310e1e2 /src/station_cmd.cpp
parentac2a6b19fc3d83e16d200fdddff2c965bb7d52b3 (diff)
downloadopenttd-795c8b2f9c2d5b6a7ccf0504f62d8426a8bc79ec.tar.xz
UNDERGROUND_COST_MULTIPLIER new
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index d833b0ef7..4d76eac82 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -819,7 +819,7 @@ CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z
return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
}
}
- cost.AddCost(_price[PR_BUILD_FOUNDATION]);
+ cost.AddCost(_price[PR_BUILD_FOUNDATION] * UNDERGROUND_COST_MULTIPLIER(tile));
}
/* The level of this tile must be equal to allowed_z. */
@@ -1057,7 +1057,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, cur_tile);
if (ret.Failed()) return ret;
cost.AddCost(ret);
- cost.AddCost(RoadBuildCost(rt) * 2);
+ cost.AddCost(RoadBuildCost(rt) * 2 * UNDERGROUND_COST_MULTIPLIER(cur_tile));
}
}
}
@@ -1297,8 +1297,8 @@ CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailTyp
CommandCost cost = CheckFlatLandRailStation(new_location, flags, axis, &est, rt, affected_vehicles, spec_class, spec_index, plat_len, numtracks);
if (cost.Failed()) return cost;
/* Add construction expenses. */
- cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len);
- cost.AddCost(numtracks * plat_len * RailBuildCost(rt));
+ cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len * UNDERGROUND_COST_MULTIPLIER(tile_org));
+ cost.AddCost(numtracks * plat_len * RailBuildCost(rt) * UNDERGROUND_COST_MULTIPLIER(tile_org));
Station *st = nullptr;
ret = FindJoiningStation(est, station_to_join, adjacent, new_location, &st);
@@ -1581,7 +1581,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_st
}
/* If we reached here, the tile is valid so increase the quantity of tiles we will remove */
- quantity++;
+ quantity += UNDERGROUND_COST_MULTIPLIER(tile);
if (keep_rail || IsStationTileBlocked(tile)) {
/* Don't refund the 'steel' of the track when we keep the