(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.

This commit is contained in:
frosch 2011-04-16 16:26:08 +00:00
parent 52b7c63683
commit 30b4bad60c
1 changed files with 3 additions and 2 deletions

View File

@ -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++;
}