From 659989af457fef67348fb1f2145ba7ff66c92d4d Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 26 Jan 2009 21:09:17 +0000 Subject: (svn r15278) -Fix [FS#2332]: test noise limit of nearest town instead of st->town --- src/ai/api/ai_airport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ai') diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp index cb8693255..2b0c3155b 100644 --- a/src/ai/api/ai_airport.cpp +++ b/src/ai/api/ai_airport.cpp @@ -115,6 +115,7 @@ /* static */ int AIAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type) { + extern Town *AirportGetNearestTown(const AirportFTAClass *afc, TileIndex airport_tile); extern uint8 GetAirportNoiseLevelForTown(const AirportFTAClass *afc, TileIndex town_tile, TileIndex tile); if (!::IsValidTile(tile)) return -1; @@ -122,7 +123,7 @@ if (_settings_game.economy.station_noise_level) { const AirportFTAClass *afc = ::GetAirport(type); - const Town *t = ::ClosestTownFromTile(tile, UINT_MAX); + const Town *t = AirportGetNearestTown(afc, tile); return GetAirportNoiseLevelForTown(afc, t->xy, tile); } -- cgit v1.2.3-70-g09d2