Improve performance of train breakdown detection

This commit is contained in:
Jonathan G Rennison
2019-01-19 04:39:16 +00:00
parent 841ea7639f
commit d87ac8ec7e
6 changed files with 15 additions and 1 deletions

View File

@@ -3137,6 +3137,14 @@ bool AfterLoadGame()
}
}
}
if (SlXvIsFeatureMissing(XSLFI_CONSIST_BREAKDOWN_FLAG)) {
Train *v;
FOR_ALL_TRAINS(v) {
if (v->breakdown_ctr != 0 && (v->IsEngine() || v->IsMultiheaded())) {
SetBit(v->First()->flags, VRF_CONSIST_BREAKDOWN);
}
}
}
/* The road owner of standard road stops was not properly accounted for. */
if (IsSavegameVersionBefore(172)) {