Fix #9113: Assertion failure when removing airport with order backup (#9182)

This commit is contained in:
Jonathan G Rennison 2021-05-03 15:03:25 +01:00 committed by GitHub
parent 1a1def99dc
commit ece9a356dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);