changeset 14452:8c526552e7d8 draft

(svn r19010) -Codechange: Remove a now unneeded check at CmdBuildRailStation.
author terkhen <terkhen@openttd.org>
date Thu, 04 Feb 2010 21:09:29 +0000
parents b0a496bfb6ec
children 336dbd07ef03
files src/station_cmd.cpp
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1006,15 +1006,14 @@
 
 	/* Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station) */
 	StationID est = INVALID_STATION;
-	/* If DC_EXEC is in flag, do not want to pass it to CheckFlatLandBelow, because of a nice bug
-	 * for detail info, see:
-	 * https://sourceforge.net/tracker/index.php?func=detail&aid=1029064&group_id=103924&atid=636365 */
-	CommandCost ret = CheckFlatLandBelow(tile_org, w_org, h_org, flags & ~DC_EXEC, 5 << axis, _settings_game.station.nonuniform_stations ? &est : NULL, true, rt);
-	if (ret.Failed()) return ret;
-	CommandCost cost(EXPENSES_CONSTRUCTION, ret.GetCost() + (numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len);
+	/* Clear the land below the station. */
+	CommandCost cost = CheckFlatLandBelow(tile_org, w_org, h_org, flags, 5 << axis, _settings_game.station.nonuniform_stations ? &est : NULL, true, rt);
+	if (cost.Failed()) return cost;
+	/* Add construction expenses. */
+	cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len);
 
 	Station *st = NULL;
-	ret = FindJoiningStation(est, station_to_join, adjacent, new_location, &st);
+	CommandCost ret = FindJoiningStation(est, station_to_join, adjacent, new_location, &st);
 	if (ret.Failed()) return ret;
 
 	/* See if there is a deleted station close to us. */
@@ -1076,12 +1075,6 @@
 		byte numtracks_orig;
 		Track track;
 
-		/* Now really clear the land below the station
-		 * It should never return CMD_ERROR.. but you never know ;)
-		 * (a bit strange function name for it, but it really does clear the land, when DC_EXEC is in flags) */
-		ret = CheckFlatLandBelow(tile_org, w_org, h_org, flags, 5 << axis, _settings_game.station.nonuniform_stations ? &est : NULL, true, rt);
-		if (ret.Failed()) return ret;
-
 		st->train_station = new_location;
 		st->AddFacility(FACIL_TRAIN, new_location.tile);