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

Function AirportFindFreeHelipad

src/aircraft_cmd.cpp:2060–2068  ·  view source on GitHub ↗

* Find a free helipad, and assign it if available. * @param v Aircraft to handle. * @param apc Airport state machine. * @return Found a free helipad and assigned it. */

Source from the content-addressed store, hash-verified

2058 * @return Found a free helipad and assigned it.
2059 */
2060static bool AirportFindFreeHelipad(Aircraft *v, const AirportFTAClass *apc)
2061{
2062 /* if an airport doesn't have helipads, use terminals */
2063 if (apc->num_helipads == 0) return AirportFindFreeTerminal(v, apc);
2064
2065 /* only 1 helicoptergroup, check all helipads
2066 * The blocks for helipads start after the last terminal (MAX_TERMINALS) */
2067 return FreeTerminal(v, MAX_TERMINALS, apc->num_helipads + MAX_TERMINALS);
2068}
2069
2070/**
2071 * Handle the 'dest too far' flag and the corresponding news message for aircraft.

Calls 2

AirportFindFreeTerminalFunction · 0.85
FreeTerminalFunction · 0.85

Tested by

no test coverage detected