MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetNumHangars

Method GetNumHangars

src/script/api/script_airport.cpp:92–103  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

90}
91
92/* static */ SQInteger ScriptAirport::GetNumHangars(TileIndex tile)
93{
94 EnforceDeityOrCompanyModeValid(-1);
95 if (!::IsValidTile(tile)) return -1;
96 if (!::IsTileType(tile, MP_STATION)) return -1;
97
98 const Station *st = ::Station::GetByTile(tile);
99 if (st->owner != ScriptObject::GetCompany() && ScriptCompanyMode::IsValid()) return -1;
100 if (!st->facilities.Test(StationFacility::Airport)) return -1;
101
102 return st->airport.GetNumHangars();
103}
104
105/* static */ TileIndex ScriptAirport::GetHangarOfAirport(TileIndex tile)
106{

Callers 1

ScriptDepotListMethod · 0.45

Calls 3

IsValidTileFunction · 0.85
IsTileTypeFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected