summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-03-13 10:43:41 +0000
committerfrosch <frosch@openttd.org>2011-03-13 10:43:41 +0000
commit2ae863463c03f76384dd1ceecdaf14d6b8259687 (patch)
tree9baeba3928127e8aee2022ebe125c8f74f2de170
parentdee05fe63dc8d7898b7e6511b22cee187076116c (diff)
downloadopenttd-2ae863463c03f76384dd1ceecdaf14d6b8259687.tar.xz
(svn r22236) -Fix (r21457): Disarm a bear-pit, which r22226 almost fell into.
-rw-r--r--src/order_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index c4f4b7d9c..eefeddbfb 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -807,8 +807,8 @@ public:
virtual void OnInvalidateData(int data)
{
- VehicleOrderID from = GB(data, 0, 8);
- VehicleOrderID to = GB(data, 8, 8);
+ VehicleOrderID from = INVALID_VEH_ORDER_ID;
+ VehicleOrderID to = INVALID_VEH_ORDER_ID;
switch (data) {
case -666:
@@ -831,6 +831,9 @@ public:
break;
default:
+ if (data < 0) break;
+ from = GB(data, 0, 8);
+ to = GB(data, 8, 8);
/* Moving an order. If one of these is INVALID_VEH_ORDER_ID, then
* the order is being created / removed */
if (this->selected_order == -1) break;