Changeset - r28475:11127afc698f
[Not reviewed]
master
0 1 0
Rubidium - 3 months ago 2024-01-15 21:12:55
rubidium@openttd.org
Fix #11785, cf16f45: when bumping aircraft into the air, remove them from the loading vehicle list again
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -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;
 
			}
 
		}
 
	}
 
}
 

	
 
/**
0 comments (0 inline, 0 general)