1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 18:09:09 +00:00

Codechange: Iterate aircraft group list for UpdateAirplanesOnNewStation

This commit is contained in:
SamuXarick
2023-12-28 15:21:16 +00:00
parent e7b505423e
commit 2ce3d10584

View File

@@ -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;