mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-20 20:19:35 +01:00
Fix 659989af45
: Set appropriate town window dirty when building/removing airports. (#9497)
This commit is contained in:
parent
b38712a302
commit
cc38a42b07
@ -2359,7 +2359,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
|||||||
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
|
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
|
||||||
|
|
||||||
if (_settings_game.economy.station_noise_level) {
|
if (_settings_game.economy.station_noise_level) {
|
||||||
SetWindowDirty(WC_TOWN_VIEW, st->town->index);
|
SetWindowDirty(WC_TOWN_VIEW, nearest->index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2407,6 +2407,10 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
|||||||
uint dist;
|
uint dist;
|
||||||
Town *nearest = AirportGetNearestTown(as, it, dist);
|
Town *nearest = AirportGetNearestTown(as, it, dist);
|
||||||
nearest->noise_reached -= GetAirportNoiseLevelForDistance(as, dist);
|
nearest->noise_reached -= GetAirportNoiseLevelForDistance(as, dist);
|
||||||
|
|
||||||
|
if (_settings_game.economy.station_noise_level) {
|
||||||
|
SetWindowDirty(WC_TOWN_VIEW, nearest->index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TileIndex tile_cur : st->airport) {
|
for (TileIndex tile_cur : st->airport) {
|
||||||
@ -2435,10 +2439,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
|||||||
|
|
||||||
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
|
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
|
||||||
|
|
||||||
if (_settings_game.economy.station_noise_level) {
|
|
||||||
SetWindowDirty(WC_TOWN_VIEW, st->town->index);
|
|
||||||
}
|
|
||||||
|
|
||||||
Company::Get(st->owner)->infrastructure.airport--;
|
Company::Get(st->owner)->infrastructure.airport--;
|
||||||
|
|
||||||
st->AfterStationTileSetChange(false, STATION_AIRPORT);
|
st->AfterStationTileSetChange(false, STATION_AIRPORT);
|
||||||
|
Loading…
Reference in New Issue
Block a user