(svn r14036) -Fix [FS#2197,FS#2198]: trains crashing into eachother when signals are changed (michi_cc)

This commit is contained in:
rubidium
2008-08-10 13:37:09 +00:00
parent 1c04049f1c
commit b1ed3bad58
2 changed files with 20 additions and 1 deletions

View File

@@ -2504,6 +2504,20 @@ bool AfterLoadGame()
}
}
/* Reserve all tracks trains are currently on. */
if (CheckSavegameVersion(101)) {
Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN) {
if ((v->u.rail.track & TRACK_BIT_WORMHOLE) == TRACK_BIT_WORMHOLE) {
TryReserveRailTrack(v->tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(v->tile)));
} else if ((v->u.rail.track & TRACK_BIT_MASK) != TRACK_BIT_NONE) {
TryReserveRailTrack(v->tile, TrackBitsToTrack(v->u.rail.track));
}
}
}
}
GamelogPrintDebug(1);
return InitializeWindowsAndCaches();