summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2006-12-22 13:16:40 +0000
committerKUDr <KUDr@openttd.org>2006-12-22 13:16:40 +0000
commit41578c2ad392fbed8003f96b2ebe2b0ea0276455 (patch)
treed3b22d9d8f5d7364d6c545a224685be0866b08b7
parentd2956c3ceb627fdf4daefa2fd5d5271f694163c8 (diff)
downloadopenttd-41578c2ad392fbed8003f96b2ebe2b0ea0276455.tar.xz
(svn r7547) -Fix: The cost of rail station removal was calculated based on the area occupied by the station. This produced unreasonably large removal costs for non-uniform stations. Now it is based on number of station tiles actually removed.
-rw-r--r--station_cmd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 21c98a9e4..7bfe6f18e 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1291,7 +1291,7 @@ uint GetPlatformLength(TileIndex tile, DiagDirection dir)
static int32 RemoveRailroadStation(Station *st, TileIndex tile, uint32 flags)
{
int w,h;
- int32 cost;
+ int32 cost = 0;
/* if there is flooding and non-uniform stations are enabled, remove platforms tile by tile */
if (_current_player == OWNER_WATER && _patches.nonuniform_stations)
@@ -1308,9 +1308,6 @@ static int32 RemoveRailroadStation(Station *st, TileIndex tile, uint32 flags)
assert(w != 0 && h != 0);
- /* cost is area * constant */
- cost = w*h*_price.remove_rail_station;
-
/* clear all areas of the station */
do {
int w_bak = w;
@@ -1319,6 +1316,7 @@ static int32 RemoveRailroadStation(Station *st, TileIndex tile, uint32 flags)
if (TileBelongsToRailStation(st, tile)) {
if (!EnsureNoVehicle(tile))
return CMD_ERROR;
+ cost += _price.remove_rail_station;
if (flags & DC_EXEC) {
Track track = GetRailStationTrack(tile);
DoClearSquare(tile);