mirror of https://github.com/OpenTTD/OpenTTD.git
(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:
parent
52b7c63683
commit
30b4bad60c
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue