Changeset - r7950:d9a10d77b610
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-11-24 09:14:58
rubidium@openttd.org
(svn r11506) -Fix [FS#1471]: selling vehicles could cause the window of others to scroll to that location.
1 file changed with 4 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -537,13 +537,10 @@ void Vehicle::PreDestructor()
 
		delete this->Next();
 
	}
 

	
 
	Window **wp;
 
	FOR_ALL_WINDOWS(wp) {
 
		Window *w = *wp;
 
		if (w->viewport != 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
 
			WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
 
		}
 
	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
 
		WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
 
	}
 
}
 

	
0 comments (0 inline, 0 general)