summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-02-02 16:46:42 +0000
committerplanetmaker <planetmaker@openttd.org>2011-02-02 16:46:42 +0000
commit0364726bbbb1ac7871b732aa5ed79beb2d4e903e (patch)
tree225a0b0ae965bafc21ba7ee9486a1275161eb6d3 /src/saveload
parentb15719bbd216966661ed66d8a54c17b27d77f391 (diff)
downloadopenttd-0364726bbbb1ac7871b732aa5ed79beb2d4e903e.tar.xz
(svn r21940) -Fix [FS#4460]: Not all vehicles should be tested to be inside a tunnel upon savegame load (SmatZ)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 5948415a6..4c561d8de 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2377,6 +2377,10 @@ bool AfterLoadGame()
* get messed up just after loading the savegame. This fixes that. */
Vehicle *v;
FOR_ALL_VEHICLES(v) {
+ /* Not all vehicle types can be inside a tunnel. Furthermore,
+ * testing IsTunnelTile() for invalid tiles causes a crash. */
+ if (!v->IsGroundVehicle()) continue;
+
/* Is the vehicle in a tunnel? */
if (!IsTunnelTile(v->tile)) continue;