From 30b4bad60cc914902fe29df52e89d64871d6a297 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 16 Apr 2011 16:26:08 +0000 Subject: [PATCH] (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. --- src/order_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 4441a782b8..66b5bf25d5 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++; }