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

Function GetTargetAirportIfValid

src/aircraft_cmd.cpp:2163–2171  ·  view source on GitHub ↗

* Returns aircraft's target station if v->target_airport * is a valid station with airport. * @param v vehicle to get target airport for * @return pointer to target station, nullptr if invalid */

Source from the content-addressed store, hash-verified

2161 * @return pointer to target station, nullptr if invalid
2162 */
2163Station *GetTargetAirportIfValid(const Aircraft *v)
2164{
2165 assert(v->type == VEH_AIRCRAFT);
2166
2167 Station *st = Station::GetIfValid(v->targetairport);
2168 if (st == nullptr) return nullptr;
2169
2170 return st->airport.tile == INVALID_TILE ? nullptr : st;
2171}
2172
2173/**
2174 * Updates the status of the Aircraft heading or in the station

Callers 10

PreDestructorMethod · 0.85
FindNearestHangarFunction · 0.85
FindClosestDepotMethod · 0.85
HandleCrashedAircraftFunction · 0.85
CrashAirplaneFunction · 0.85
MapAircraftMovementStateFunction · 0.85
VehicleGetVariableFunction · 0.85
AfterLoadGameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected