summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-17 21:50:58 +0000
committeryexo <yexo@openttd.org>2010-08-17 21:50:58 +0000
commitf9a55b7439a505167699223fdb51485113501c24 (patch)
treea1dd234094d73b5a7665f827032198297665aa0c /src/station_cmd.cpp
parentafb60ec59ca6b22614e40b4def00b2372f2789be (diff)
downloadopenttd-f9a55b7439a505167699223fdb51485113501c24.tar.xz
(svn r20529) -Codechange: simplify UpdateAirplanesOnNewStation by removing code for situations that don't happen
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 902b1ed45..77d8619d2 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2106,7 +2106,6 @@ void UpdateAirportsNoise()
*/
CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- bool airport_upgrade = true;
StationID station_to_join = GB(p2, 16, 16);
bool reuse = (station_to_join != NEW_STATION);
if (!reuse) station_to_join = INVALID_STATION;
@@ -2188,8 +2187,6 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT);
}
} else {
- airport_upgrade = false;
-
/* allocate and initialize new station */
if (!Station::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
@@ -2239,14 +2236,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
AirportTileAnimationTrigger(st, cur_tile, AAT_BUILT);
} while ((++it)->ti.x != -0x80);
- /* if airport was demolished while planes were en-route to it, the
- * positions can no longer be the same (v->u.air.pos), since different
- * airports have different indexes. So update all planes en-route to this
- * airport. Only update if
- * 1. airport is upgraded
- * 2. airport is added to existing station (unfortunately unavoideable)
- */
- if (airport_upgrade) UpdateAirplanesOnNewStation(st);
+ UpdateAirplanesOnNewStation(st);
st->UpdateVirtCoord();
UpdateStationAcceptance(st, false);