Changeset - r25911:93ba9bfb32b9
[Not reviewed]
master
0 1 0
Joan Josep - 3 years ago 2021-08-18 12:33:32
juanjo.ng.83@gmail.com
Fix 659989af45: Set appropriate town window dirty when building/removing airports. (#9497)
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2359,7 +2359,7 @@ CommandCost CmdBuildAirport(TileIndex ti
 
		InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
 

	
 
		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(TileInd
 
		uint dist;
 
		Town *nearest = AirportGetNearestTown(as, it, 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) {
 
@@ -2435,10 +2439,6 @@ static CommandCost RemoveAirport(TileInd
 

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

	
 
		st->AfterStationTileSetChange(false, STATION_AIRPORT);
0 comments (0 inline, 0 general)