mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 06:46:43 +00:00
(svn r11632) -Fix [FS#1541]: vehicles were still followed when sold.
This commit is contained in:
parent
ea1ae563c7
commit
dedb15786c
@ -538,9 +538,9 @@ void Vehicle::PreDestructor()
|
|||||||
delete this->Next();
|
delete this->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index);
|
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
|
||||||
if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) {
|
if (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
|
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;
|
WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user