* 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 */
| 2161 | * @return pointer to target station, nullptr if invalid |
| 2162 | */ |
| 2163 | Station *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 |
no outgoing calls
no test coverage detected