summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-14 21:16:21 +0000
committeryexo <yexo@openttd.org>2009-02-14 21:16:21 +0000
commite7eb6d05a063db3e4bdf9e9a91d2e18f486393c5 (patch)
tree0080f4623a8ee03c92d581adb1d7f6de837db053 /src
parent8583274f183dd88c7488d35e36efe340033bed76 (diff)
downloadopenttd-e7eb6d05a063db3e4bdf9e9a91d2e18f486393c5.tar.xz
(svn r15489) -Change [API CHANGE]: Remove AIAirport::AirportAvailable. AIAirport::IsValidAirportType now only returns true for available AirportTypes.
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_airport.cpp9
-rw-r--r--src/ai/api/ai_airport.hpp10
-rw-r--r--src/ai/api/ai_airport.hpp.sq1
3 files changed, 3 insertions, 17 deletions
diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp
index b2b969b82..ed58701c3 100644
--- a/src/ai/api/ai_airport.cpp
+++ b/src/ai/api/ai_airport.cpp
@@ -11,7 +11,7 @@
/* static */ bool AIAirport::IsValidAirportType(AirportType type)
{
- return type >= AT_SMALL && type <= AT_HELISTATION;
+ return type >= AT_SMALL && type <= AT_HELISTATION && HasBit(::GetValidAirports(), type);
}
/* static */ bool AIAirport::IsHangarTile(TileIndex tile)
@@ -28,13 +28,6 @@
return ::IsTileType(tile, MP_STATION) && ::IsAirport(tile);
}
-/* static */ bool AIAirport::AirportAvailable(AirportType type)
-{
- if (!IsValidAirportType(type)) return false;
-
- return HasBit(::GetValidAirports(), type);
-}
-
/* static */ int32 AIAirport::GetAirportWidth(AirportType type)
{
if (!IsValidAirportType(type)) return -1;
diff --git a/src/ai/api/ai_airport.hpp b/src/ai/api/ai_airport.hpp
index 559d9c6ae..88d208043 100644
--- a/src/ai/api/ai_airport.hpp
+++ b/src/ai/api/ai_airport.hpp
@@ -47,9 +47,9 @@ public:
};
/**
- * Checks whether the given AirportType is valid.
+ * Checks whether the given AirportType is valid and available.
* @param type The AirportType to check.
- * @return True if and only if the AirportTypeis valid.
+ * @return True if and only if the AirportType is valid and available.
*/
static bool IsValidAirportType(AirportType type);
@@ -70,12 +70,6 @@ public:
static bool IsAirportTile(TileIndex tile);
/**
- * Check if a certain airport type is already available.
- * @param type The type of airport to check.
- */
- static bool AirportAvailable(AirportType type);
-
- /**
* Get the width of this type of airport.
* @param type The type of airport.
* @return The width in tiles.
diff --git a/src/ai/api/ai_airport.hpp.sq b/src/ai/api/ai_airport.hpp.sq
index f84412869..fdf8153b6 100644
--- a/src/ai/api/ai_airport.hpp.sq
+++ b/src/ai/api/ai_airport.hpp.sq
@@ -41,7 +41,6 @@ void SQAIAirport_Register(Squirrel *engine) {
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType, "IsValidAirportType", 2, "?i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile, "IsHangarTile", 2, "?i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile, "IsAirportTile", 2, "?i");
- SQAIAirport.DefSQStaticMethod(engine, &AIAirport::AirportAvailable, "AirportAvailable", 2, "?i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, "?i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight, "GetAirportHeight", 2, "?i");
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, "?i");