summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-17 13:54:06 +0000
committersmatz <smatz@openttd.org>2009-07-17 13:54:06 +0000
commit57d3d4ce5e9f9333c27b47e5a66d2c3604ce8dc9 (patch)
treebfa744e206782c6e53b2c7f58c7ee81c0d7b98e7 /src/saveload
parentb9cf3f880b8c25a1db7483356ddaeb1dee83ad0e (diff)
downloadopenttd-57d3d4ce5e9f9333c27b47e5a66d2c3604ce8dc9.tar.xz
(svn r16857) -Fix [FS#3036](r16652): crash when train partially in depot crashed
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index a26ef0e6b..7879af4e7 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1708,18 +1708,9 @@ bool AfterLoadGame()
/* Reserve all tracks trains are currently on. */
if (CheckSavegameVersion(101)) {
- Train *t;
+ const Train *t;
FOR_ALL_TRAINS(t) {
- switch (t->track) {
- case TRACK_BIT_WORMHOLE:
- TryReserveRailTrack(t->tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(t->tile)));
- break;
- case TRACK_BIT_DEPOT:
- break;
- default:
- TryReserveRailTrack(t->tile, TrackBitsToTrack(t->track));
- break;
- }
+ if (t->First() == t) t->ReserveTrackUnderConsist();
}
}