From f129ba40a7fde8aeaa9b96294a17173fbfeed3fc Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 25 Apr 2008 16:33:40 +0000 Subject: (svn r12904) -Fix [FS#1953]: remove trams from savegames saved in OTTD without tram support, it is better than to simply crash --- src/vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicle.cpp') 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; } -- cgit v1.2.3-54-g00ecf