|
@@ -2188,13 +2188,12 @@ CommandCost CmdBuildAirport(TileIndex ti
|
|
|
|
|
|
st->AddFacility(FACIL_AIRPORT, tile);
|
|
|
st->airport.type = airport_type;
|
|
|
st->airport.layout = layout;
|
|
|
st->airport.flags = 0;
|
|
|
st->airport.rotation = rotation;
|
|
|
st->airport.psa.ResetToZero();
|
|
|
|
|
|
st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TRY);
|
|
|
|
|
|
it = as->table[layout];
|
|
|
do {
|
|
|
TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
|
|
@@ -2268,12 +2267,15 @@ static CommandCost RemoveAirport(TileInd
|
|
|
DoClearSquare(tile_cur);
|
|
|
DeleteNewGRFInspectWindow(GSF_AIRPORTTILES, tile_cur);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (flags & DC_EXEC) {
|
|
|
/* Clear the persistent storage. */
|
|
|
delete st->airport.psa;
|
|
|
|
|
|
const AirportSpec *as = st->airport.GetSpec();
|
|
|
for (uint i = 0; i < st->airport.GetNumHangars(); ++i) {
|
|
|
DeleteWindowById(
|
|
|
WC_VEHICLE_DEPOT, st->airport.GetHangarTile(i)
|
|
|
);
|
|
|
}
|
|
@@ -2285,13 +2287,12 @@ static CommandCost RemoveAirport(TileInd
|
|
|
nearest->noise_reached -= GetAirportNoiseLevelForTown(as, nearest->xy, tile);
|
|
|
|
|
|
st->rect.AfterRemoveRect(st, st->airport);
|
|
|
|
|
|
st->airport.Clear();
|
|
|
st->facilities &= ~FACIL_AIRPORT;
|
|
|
st->airport.psa.ResetToZero();
|
|
|
|
|
|
SetWindowWidgetDirty(WC_STATION_VIEW, st->index, SVW_PLANES);
|
|
|
|
|
|
if (_settings_game.economy.station_noise_level) {
|
|
|
SetWindowDirty(WC_TOWN_VIEW, st->town->index);
|
|
|
}
|