From bf3a9dfdaf5c1c88c9ce7141f209f244f59e7d33 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 1 Aug 2011 20:15:18 +0000 Subject: (svn r22710) -Fix [FS#4704]: Allow AIAirport::GetNoiseLevelIncrease() also for expired airports. --- src/ai/api/ai_airport.cpp | 2 +- src/ai/api/ai_airport.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ai/api') diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp index c52e5abd2..ac0dd6422 100644 --- a/src/ai/api/ai_airport.cpp +++ b/src/ai/api/ai_airport.cpp @@ -131,7 +131,7 @@ extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIndex town_tile, TileIndex tile); if (!::IsValidTile(tile)) return -1; - if (!IsValidAirportType(type)) return -1; + if (!IsAirportInformationAvailable(type)) return -1; if (_settings_game.economy.station_noise_level) { const AirportSpec *as = ::AirportSpec::Get(type); diff --git a/src/ai/api/ai_airport.hpp b/src/ai/api/ai_airport.hpp index a058209c6..a889b3289 100644 --- a/src/ai/api/ai_airport.hpp +++ b/src/ai/api/ai_airport.hpp @@ -180,6 +180,7 @@ public: * built at this tile. * @param tile The tile to check. * @param type The AirportType to check. + * @pre IsAirportInformationAvailable(type). * @return The amount of noise added to the nearest town. * @note The noise will be added to the town with TownID GetNearestTown(tile, type). */ -- cgit v1.2.3-70-g09d2