bool hangar_in_o = false;
const Order *o;
/* Is there at least an airport with a hangar in the orders? */
FOR_VEHICLE_ORDERS(v, o) {
if (o->IsType(OT_GOTO_STATION)) {
const Station *ost = Station::Get(o->GetDestination());
if (CanVehicleUseStation(v, ost) && (ost->airport.HasHangar() ||
/* Helicopters can be serviced at helipads as long as there is no pending replace and serviceathelipad is enabled */
(v->subtype == AIR_HELICOPTER && !v->HasPendingReplace() && _settings_game.order.serviceathelipad && ost->airport.GetFTA()->num_helipads))) {
hangar_in_o = true;
break;
}
}
}