mirror of https://github.com/OpenTTD/OpenTTD
(svn r22200) -Fix (r21642): removing a station order could stop when removing first automatic order
parent
b8d3c42de2
commit
469c448eb0
|
@ -1638,6 +1638,7 @@ void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination)
|
||||||
int id = -1;
|
int id = -1;
|
||||||
FOR_VEHICLE_ORDERS(v, order) {
|
FOR_VEHICLE_ORDERS(v, order) {
|
||||||
id++;
|
id++;
|
||||||
|
restart:
|
||||||
|
|
||||||
OrderType ot = order->GetType();
|
OrderType ot = order->GetType();
|
||||||
if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue;
|
if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue;
|
||||||
|
@ -1647,9 +1648,10 @@ void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination)
|
||||||
* dummy orders. They should just vanish. Also check the actual order
|
* dummy orders. They should just vanish. Also check the actual order
|
||||||
* type as ot is currently OT_GOTO_STATION. */
|
* type as ot is currently OT_GOTO_STATION. */
|
||||||
if (order->IsType(OT_AUTOMATIC)) {
|
if (order->IsType(OT_AUTOMATIC)) {
|
||||||
|
order = order->next; // DeleteOrder() invalidates current order
|
||||||
DeleteOrder(v, id);
|
DeleteOrder(v, id);
|
||||||
id--;
|
if (order != NULL) goto restart;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
order->MakeDummy();
|
order->MakeDummy();
|
||||||
|
|
Loading…
Reference in New Issue