summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-25 16:33:40 +0000
committersmatz <smatz@openttd.org>2008-04-25 16:33:40 +0000
commitf129ba40a7fde8aeaa9b96294a17173fbfeed3fc (patch)
treed8db094c166ef1686fc3cbd441747a5c0dc23cb1 /src/vehicle.cpp
parent81859bb7ad9ba9c83659ed833fe439cd8f027fa3 (diff)
downloadopenttd-f129ba40a7fde8aeaa9b96294a17173fbfeed3fc.tar.xz
(svn r12904) -Fix [FS#1953]: remove trams from savegames saved in OTTD without tram support, it is better than to simply crash
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index d8acda4ab..ec4908669 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -591,7 +591,7 @@ void Vehicle::PreDestructor()
}
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
- if (WP(w, vp_d).follow_vehicle == this->index) {
+ if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) {
ScrollMainWindowTo(this->x_pos, this->y_pos, true); // lock the main view on the vehicle's last position
WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
}