changeset 17906:abfee8b3ca37 draft

(svn r22710) -Fix [FS#4704]: Allow AIAirport::GetNoiseLevelIncrease() also for expired airports.
author frosch <frosch@openttd.org>
date Mon, 01 Aug 2011 20:15:18 +0000
parents b1f6f7bb52fa
children 7da826741dff
files src/ai/api/ai_airport.cpp src/ai/api/ai_airport.hpp
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- a/src/ai/api/ai_airport.hpp
+++ b/src/ai/api/ai_airport.hpp
@@ -180,6 +180,7 @@
 	 *  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).
 	 */