From dedb15786c1caac8f57a3dc48d1c56b2dec0c92e Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 14 Dec 2007 21:11:30 +0000 Subject: [PATCH] (svn r11632) -Fix [FS#1541]: vehicles were still followed when sold. --- src/vehicle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 70e4fbe198..7f4e16d98f 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -538,9 +538,9 @@ void Vehicle::PreDestructor() delete this->Next(); } - Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index); - if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) { - ScrollMainWindowTo(this->x_pos, this->y_pos); // lock the main view on the vehicle's last position + Window *w = FindWindowById(WC_MAIN_WINDOW, 0); + if (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; } }