Mercurial > hg > openttd
changeset 17481:11a702d3a325 draft
(svn r22236) -Fix (r21457): Disarm a bear-pit, which r22226 almost fell into.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 13 Mar 2011 10:43:41 +0000 |
parents | b46b3eae1c43 |
children | 3fe2f71a76db |
files | src/order_gui.cpp |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -807,8 +807,8 @@ 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 @@ 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;