mirror of https://github.com/OpenTTD/OpenTTD
Fix #10216: Initialise RoadStop caches before using them and don't try to teleport crashed vehicles (#10217)
parent
2c5eb206d4
commit
13d2d11fa8
|
@ -3155,6 +3155,9 @@ bool AfterLoadGame()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Road stops is 'only' updating some caches, but they are needed for PF calls in SLV_MULTITRACK_LEVEL_CROSSINGS teleporting. */
|
||||||
|
AfterLoadRoadStops();
|
||||||
|
|
||||||
/* Road vehicles stopped on multitrack level crossings need teleporting to a depot
|
/* Road vehicles stopped on multitrack level crossings need teleporting to a depot
|
||||||
* to avoid crashing into the side of the train they're waiting for. */
|
* to avoid crashing into the side of the train they're waiting for. */
|
||||||
if (IsSavegameVersionBefore(SLV_MULTITRACK_LEVEL_CROSSINGS)) {
|
if (IsSavegameVersionBefore(SLV_MULTITRACK_LEVEL_CROSSINGS)) {
|
||||||
|
@ -3166,6 +3169,9 @@ bool AfterLoadGame()
|
||||||
/* Ignore moving vehicles. */
|
/* Ignore moving vehicles. */
|
||||||
if (rv->cur_speed > 0) continue;
|
if (rv->cur_speed > 0) continue;
|
||||||
|
|
||||||
|
/* Ignore crashed vehicles. */
|
||||||
|
if (rv->vehstatus & VS_CRASHED) continue;
|
||||||
|
|
||||||
/* Ignore vehicles not on level crossings. */
|
/* Ignore vehicles not on level crossings. */
|
||||||
TileIndex cur_tile = rv->tile;
|
TileIndex cur_tile = rv->tile;
|
||||||
if (!IsLevelCrossingTile(cur_tile)) continue;
|
if (!IsLevelCrossingTile(cur_tile)) continue;
|
||||||
|
@ -3207,8 +3213,6 @@ bool AfterLoadGame()
|
||||||
for (Station *st : Station::Iterate()) UpdateStationAcceptance(st, false);
|
for (Station *st : Station::Iterate()) UpdateStationAcceptance(st, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Road stops is 'only' updating some caches */
|
|
||||||
AfterLoadRoadStops();
|
|
||||||
AfterLoadLabelMaps();
|
AfterLoadLabelMaps();
|
||||||
AfterLoadCompanyStats();
|
AfterLoadCompanyStats();
|
||||||
AfterLoadStoryBook();
|
AfterLoadStoryBook();
|
||||||
|
|
Loading…
Reference in New Issue