(svn r11632) -Fix [FS#1541]: vehicles were still followed when sold.
authorrubidium
Fri, 14 Dec 2007 21:11:30 +0000
changeset 8567 51dacd0fa180
parent 8566 94fb2c4351dd
child 8568 a82225425c24
(svn r11632) -Fix [FS#1541]: vehicles were still followed when sold.
src/vehicle.cpp
--- a/src/vehicle.cpp	Fri Dec 14 00:25:00 2007 +0000
+++ b/src/vehicle.cpp	Fri Dec 14 21:11:30 2007 +0000
@@ -538,9 +538,9 @@
 		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;
 	}
 }