diff options
author | smatz <smatz@openttd.org> | 2008-04-25 16:33:40 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-04-25 16:33:40 +0000 |
commit | 805e1db332d3a746a7ce453f62b83d4442078a0b (patch) | |
tree | d8db094c166ef1686fc3cbd441747a5c0dc23cb1 /src/vehicle.cpp | |
parent | 4e80f3f3b1befb54a7818ab678fa27e79273ddc3 (diff) | |
download | openttd-805e1db332d3a746a7ce453f62b83d4442078a0b.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.cpp | 2 |
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; } |