mirror of https://github.com/OpenTTD/OpenTTD
(svn r21991) -Fix [FS#4466]: The share/copy-orders-cursor was not updated to refer to the new vehicle when it got autoreplaced/-renewed.
parent
2fbecaf4bf
commit
3bb7f7ebe4
|
@ -1105,8 +1105,16 @@ static inline void ChangeVehicleWindow(WindowClass window_class, VehicleID from_
|
||||||
{
|
{
|
||||||
Window *w = FindWindowById(window_class, from_index);
|
Window *w = FindWindowById(window_class, from_index);
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
|
/* Update window_number */
|
||||||
w->window_number = to_index;
|
w->window_number = to_index;
|
||||||
if (w->viewport != NULL) w->viewport->follow_vehicle = to_index;
|
if (w->viewport != NULL) w->viewport->follow_vehicle = to_index;
|
||||||
|
|
||||||
|
/* Update vehicle drag data */
|
||||||
|
if (_thd.window_class == window_class && _thd.window_number == (WindowNumber)from_index) {
|
||||||
|
_thd.window_number = to_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Notify the window */
|
||||||
w->InvalidateData();
|
w->InvalidateData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue