Changeset - r28493:a914696f76bb
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 11 months ago 2024-01-16 00:55:09
j.g.rennison@gmail.com
Fix 661bdae2: cargo_payment not cleared when aircraft loading cancelled
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -20,12 +20,13 @@
 
#include "../timetable.h"
 
#include "../station_base.h"
 
#include "../effectvehicle_base.h"
 
#include "../company_base.h"
 
#include "../company_func.h"
 
#include "../disaster_vehicle.h"
 
#include "../economy_base.h"
 

	
 
#include "../safeguards.h"
 

	
 
/**
 
 * Link front and rear multiheaded engines to each other
 
 * This is done when loading a savegame
 
@@ -202,12 +203,13 @@ void UpdateOldAircraft()
 
	/* 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);
 
				delete v->cargo_payment;
 
			} else {
 
				++iter;
 
			}
 
		}
 
	}
 
}
0 comments (0 inline, 0 general)