Clear VF_CARGO_UNLOADING flag from vehicles with no cargo_payment

Bump train_through_load savegame version
This commit is contained in:
Jonathan G Rennison
2018-06-01 20:05:53 +01:00
parent 5609394b4e
commit 4007338280
2 changed files with 12 additions and 1 deletions

View File

@@ -3458,6 +3458,17 @@ bool AfterLoadGame()
}
}
if (SlXvIsFeaturePresent(XSLFI_TRAIN_THROUGH_LOAD, 0, 1)) {
Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (v->cargo_payment == nullptr) {
for (Vehicle *u = v; u != NULL; u = u->Next()) {
if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING)) ClrBit(v->vehicle_flags, VF_CARGO_UNLOADING);
}
}
}
}
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();