summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-03-13 21:33:02 +0000
committerfrosch <frosch@openttd.org>2011-03-13 21:33:02 +0000
commitf051a81b4e5064f6b5c1d00f4a7d0ae38f768e35 (patch)
treed46d4b664842c0baa010d593bb864e1e9eca1702 /src/order_gui.cpp
parent0ff4f31723c22a53dec3c44de64b0385355e972d (diff)
downloadopenttd-f051a81b4e5064f6b5c1d00f4a7d0ae38f768e35.tar.xz
(svn r22244) -Codechange: Make vehicle windows handle command-/GUI-scope invalidations themself (from autoreplace and refitting).
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index f12b104cc..d23648383 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -812,7 +812,6 @@ public:
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
{
- if (!gui_scope) return;
VehicleOrderID from = INVALID_VEH_ORDER_ID;
VehicleOrderID to = INVALID_VEH_ORDER_ID;
@@ -820,7 +819,6 @@ public:
case -666:
/* Autoreplace replaced the vehicle */
this->vehicle = Vehicle::Get(this->window_number);
- /* This case is _not_ called asynchronously. Get out directly, rest can be done later */
break;
case -1:
@@ -837,6 +835,7 @@ public:
break;
default:
+ if (!gui_scope) break;
if (data < 0) break;
from = GB(data, 0, 8);
to = GB(data, 8, 8);
@@ -869,7 +868,7 @@ public:
}
this->vscroll->SetCount(this->vehicle->GetNumOrders() + 1);
- this->UpdateButtonState();
+ if (gui_scope) this->UpdateButtonState();
/* Scroll to the new order. */
if (from == INVALID_VEH_ORDER_ID && to != INVALID_VEH_ORDER_ID && !this->vscroll->IsVisible(to)) {