summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2021-05-03 15:03:25 +0100
committerGitHub <noreply@github.com>2021-05-03 15:03:25 +0100
commitece9a356dcae3c9f7fe85a0f7dab87e06d8eb299 (patch)
treebce499729853870abcab10b4c1106d29939110ad /src
parent1a1def99dc0913d8887a04b8132f308934cd57ee (diff)
downloadopenttd-ece9a356dcae3c9f7fe85a0f7dab87e06d8eb299.tar.xz
Fix #9113: Assertion failure when removing airport with order backup (#9182)
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index f642a914f..451dedbad 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2394,9 +2394,9 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
if (flags & DC_EXEC) {
for (uint i = 0; i < st->airport.GetNumHangars(); ++i) {
- DeleteWindowById(
- WC_VEHICLE_DEPOT, st->airport.GetHangarTile(i)
- );
+ TileIndex tile_cur = st->airport.GetHangarTile(i);
+ OrderBackup::Reset(tile_cur, false);
+ DeleteWindowById(WC_VEHICLE_DEPOT, tile_cur);
}
const AirportSpec *as = st->airport.GetSpec();
@@ -2418,7 +2418,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
cost.AddCost(_price[PR_CLEAR_STATION_AIRPORT]);
if (flags & DC_EXEC) {
- if (IsHangarTile(tile_cur)) OrderBackup::Reset(tile_cur, false);
DeleteAnimatedTile(tile_cur);
DoClearSquare(tile_cur);
DeleteNewGRFInspectWindow(GSF_AIRPORTTILES, tile_cur);