Index: src/ai/api/ai_airport.hpp =================================================================== --- src/ai/api/ai_airport.hpp (revision 12187) +++ src/ai/api/ai_airport.hpp (working copy) @@ -83,7 +83,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the airport has been/can be build or not. */ - bool BuildAirport(TileIndex tile, AirportType type); + static bool BuildAirport(TileIndex tile, AirportType type); /** * Removes a airport. @@ -91,7 +91,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the airport has been/can be removed or not. */ - bool RemoveAirport(TileIndex tile); + static bool RemoveAirport(TileIndex tile); /** * Get the first hanger tile of the airport. @@ -99,7 +99,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return the first hanger tile of the airport. */ - TileIndex GetHangarOfAirport(TileIndex tile); + static TileIndex GetHangarOfAirport(TileIndex tile); }; #endif /* AI_AIRPORT_HPP */ Index: src/ai/api/ai_airport.cpp =================================================================== --- src/ai/api/ai_airport.cpp (revision 12187) +++ src/ai/api/ai_airport.cpp (working copy) @@ -47,16 +47,16 @@ return _patches.modified_catchment ? GetAirport(type)->catchment : 4; } -bool AIAirport::BuildAirport(TileIndex tile, AirportType type) +/* static */ bool AIAirport::BuildAirport(TileIndex tile, AirportType type) { /* Outside of the map */ if (tile >= ::MapSize()) return false; if (type > AT_HELISTATION) return 0; - return this->DoCommand(tile, type, 0, CMD_BUILD_AIRPORT); + return DoCommand(tile, type, 0, CMD_BUILD_AIRPORT); } -bool AIAirport::RemoveAirport(TileIndex tile) +/* static */ bool AIAirport::RemoveAirport(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -64,10 +64,10 @@ /* Not a airport tile */ if (!IsAirportTile(tile) && !IsHangarTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); } -TileIndex AIAirport::GetHangarOfAirport(TileIndex tile) +/* static */ TileIndex AIAirport::GetHangarOfAirport(TileIndex tile) { if (!IsTileType(tile, MP_STATION)) return INVALID_TILE; Index: src/ai/api/ai_airport.hpp.sq =================================================================== --- src/ai/api/ai_airport.hpp.sq (revision 12187) +++ src/ai/api/ai_airport.hpp.sq (working copy) @@ -35,10 +35,9 @@ SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, "xi"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight, "GetAirportHeight", 2, "xi"); SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, "xi"); + SQAIAirport.DefSQStaticMethod(engine, &AIAirport::BuildAirport, "BuildAirport", 3, "xii"); + SQAIAirport.DefSQStaticMethod(engine, &AIAirport::RemoveAirport, "RemoveAirport", 2, "xi"); + SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetHangarOfAirport, "GetHangarOfAirport", 2, "xi"); - SQAIAirport.DefSQMethod(engine, &AIAirport::BuildAirport, "BuildAirport", 3, "xii"); - SQAIAirport.DefSQMethod(engine, &AIAirport::RemoveAirport, "RemoveAirport", 2, "xi"); - SQAIAirport.DefSQMethod(engine, &AIAirport::GetHangarOfAirport, "GetHangarOfAirport", 2, "xi"); - SQAIAirport.PostRegister(engine); }