diff options
author | rubidium <rubidium@openttd.org> | 2008-08-10 13:37:09 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-10 13:37:09 +0000 |
commit | b1ed3bad58d892b38e9a99f6ae7df2df5d1a034d (patch) | |
tree | 63878773a61a968be24af5becbc0b17b5e83efe0 /src/openttd.cpp | |
parent | 1c04049f1cff8690b8ea54c62a2674821cc12aa2 (diff) | |
download | openttd-b1ed3bad58d892b38e9a99f6ae7df2df5d1a034d.tar.xz |
(svn r14036) -Fix [FS#2197,FS#2198]: trains crashing into eachother when signals are changed (michi_cc)
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index e09a8501b..31f175fcb 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -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(); |