(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.
authorKUDr
Fri, 22 Dec 2006 13:16:40 +0000
changeset 5550 51afc7c8dafa
parent 5549 b7f6571fc4f3
child 5551 5cc56d0e6f5f
(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.
station_cmd.c
--- a/station_cmd.c	Fri Dec 22 01:19:32 2006 +0000
+++ b/station_cmd.c	Fri Dec 22 13:16:40 2006 +0000
@@ -1291,7 +1291,7 @@
 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 @@
 
 	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 @@
 			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);