mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
TBTR: Check for mixed virtual/non-virtual consists on load
This commit is contained in:
parent
f1946af707
commit
bba36aef1b
@ -252,8 +252,13 @@ void AfterLoadVehicles(bool part_of_load)
|
|||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
/* Reinstate the previous pointer */
|
/* Reinstate the previous pointer */
|
||||||
if (v->Next() != NULL) v->Next()->previous = v;
|
if (v->Next() != nullptr) {
|
||||||
if (v->NextShared() != NULL) v->NextShared()->previous_shared = v;
|
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;
|
if (part_of_load) v->fill_percent_te_id = INVALID_TE_ID;
|
||||||
v->first = NULL;
|
v->first = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user