summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-04-16 16:26:08 +0000
committerfrosch <frosch@openttd.org>2011-04-16 16:26:08 +0000
commit30b4bad60cc914902fe29df52e89d64871d6a297 (patch)
tree949c49a15d900256a3292d5edb1cb0360636f58f /src
parent52b7c63683311e022692bf7e2dd173c58887cb09 (diff)
downloadopenttd-30b4bad60cc914902fe29df52e89d64871d6a297.tar.xz
(svn r22326) -Fix: Destinations of conditional orders were update incorrectly when deleting orders in front of the conditional orders, if the target order wwas the order just before of the conditional order.
Diffstat (limited to 'src')
-rw-r--r--src/order_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 4441a782b..66b5bf25d 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -969,11 +969,12 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord)
if (order->IsType(OT_CONDITIONAL)) {
VehicleOrderID order_id = order->GetConditionSkipToOrder();
if (order_id >= sel_ord) {
- order->SetConditionSkipToOrder(max(order_id - 1, 0));
+ order_id = max(order_id - 1, 0);
}
if (order_id == cur_order_id) {
- order->SetConditionSkipToOrder((order_id + 1) % v->GetNumOrders());
+ order_id = (order_id + 1) % v->GetNumOrders();
}
+ order->SetConditionSkipToOrder(order_id);
}
cur_order_id++;
}