(svn r12904) -Fix [FS#1953]: remove trams from savegames saved in OTTD without tram support, it is better than to simply crash

This commit is contained in:
smatz
2008-04-25 16:33:40 +00:00
parent 4e80f3f3b1
commit 805e1db332
3 changed files with 18 additions and 1 deletions

View File

@@ -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;
}