(svn r11506) -Fix [FS#1471]: selling vehicles could cause the window of others to scroll to that location.

pull/155/head
rubidium 17 years ago
parent 7562d21e50
commit 49e2e29685

@ -537,13 +537,10 @@ void Vehicle::PreDestructor()
delete this->Next(); delete this->Next();
} }
Window **wp; Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index);
FOR_ALL_WINDOWS(wp) { if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) {
Window *w = *wp; ScrollMainWindowTo(this->x_pos, this->y_pos); // lock the main view on the vehicle's last position
if (w->viewport != NULL && WP(w, vp_d).follow_vehicle == this->index) { WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
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;
}
} }
} }

Loading…
Cancel
Save