Merge branch 'template_train_replacement' into jgrpp

# Conflicts:
#	src/saveload/vehicle_sl.cpp
This commit is contained in:
Jonathan G Rennison
2019-07-11 03:16:29 +01:00

View File

@@ -254,7 +254,12 @@ void AfterLoadVehicles(bool part_of_load)
SCOPE_INFO_FMT([&v], "AfterLoadVehicles: %s", scope_dumper().VehicleInfo(v));
FOR_ALL_VEHICLES(v) {
/* Reinstate the previous pointer */
if (v->Next() != nullptr) v->Next()->previous = v;
if (v->Next() != nullptr) {
v->Next()->previous = v;
if (HasBit(v->subtype, GVSF_VIRTUAL) != HasBit(v->Next()->subtype, GVSF_VIRTUAL)) {
SlErrorCorrupt("Mixed virtual/non-virtual vehicle consist");
}
}
if (v->NextShared() != nullptr) v->NextShared()->previous_shared = v;
if (part_of_load) v->fill_percent_te_id = INVALID_TE_ID;