mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Iterate aircraft group list for UpdateAirplanesOnNewStation
parent
e7b505423e
commit
2ce3d10584
|
@ -2144,8 +2144,10 @@ void UpdateAirplanesOnNewStation(const Station *st)
|
|||
const AirportFTAClass *ap = st->airport.GetFTA();
|
||||
Direction rotation = st->airport.tile == INVALID_TILE ? DIR_N : st->airport.rotation;
|
||||
|
||||
for (Aircraft *v : Aircraft::Iterate()) {
|
||||
if (!v->IsNormalAircraft() || v->targetairport != st->index) continue;
|
||||
const VehicleList &vehicle_list = Company::Get(st->owner)->group_all[VEH_AIRCRAFT].vehicle_list;
|
||||
for (const Vehicle *vehicle : vehicle_list) {
|
||||
Aircraft *v = Aircraft::From(Vehicle::Get(vehicle->index));
|
||||
if (v->targetairport != st->index) continue;
|
||||
assert(v->state == FLYING);
|
||||
|
||||
Order *o = &v->current_order;
|
||||
|
|
Loading…
Reference in New Issue