mirror of https://github.com/OpenTTD/OpenTTD
(svn r14007) -Fix [FS#2098]: Notify vehicle windows when their internal state is botched up from outside.
parent
cffd5d17de
commit
acf224683d
|
@ -619,6 +619,12 @@ public:
|
||||||
this->FindWindowPlacementAndResize(desc);
|
this->FindWindowPlacementAndResize(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void OnInvalidateData(int data = 0)
|
||||||
|
{
|
||||||
|
/* Autoreplace replaced the vehicle */
|
||||||
|
this->vehicle = GetVehicle(this->window_number);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void OnPaint()
|
virtual void OnPaint()
|
||||||
{
|
{
|
||||||
bool shared_orders = this->vehicle->IsOrderListShared();
|
bool shared_orders = this->vehicle->IsOrderListShared();
|
||||||
|
|
|
@ -642,7 +642,7 @@ static inline void ChangeVehicleWindow(WindowClass window_class, VehicleID from_
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
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;
|
||||||
w->SetDirty();
|
if (to_index != INVALID_VEHICLE) InvalidateThisWindowData(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue