Skip to content

Commit

Permalink
Fix #11785, cf16f45: when bumping aircraft into the air, remove them …
Browse files Browse the repository at this point in the history
…from the loading vehicle list again
  • Loading branch information
rubidium42 committed Jan 15, 2024
1 parent f997935 commit 661bdae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/saveload/vehicle_sl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ void UpdateOldAircraft()
SetAircraftPosition(a, gp.x, gp.y, GetAircraftFlightLevel(a));
}
}

/* Clear aircraft from loading vehicles, if we bumped them into the air. */
for (Station *st : Station::Iterate()) {
for (auto iter = st->loading_vehicles.begin(); iter != st->loading_vehicles.end(); /* nothing */) {
Vehicle *v = *iter;
if (v->type == VEH_AIRCRAFT && !v->current_order.IsType(OT_LOADING)) {
iter = st->loading_vehicles.erase(iter);
} else {
++iter;
}
}
}
}

/**
Expand Down

0 comments on commit 661bdae

Please sign in to comment.