Update to 1.9.0-RC1
This commit is contained in:
@@ -1835,8 +1835,11 @@ void CheckOrders(const Vehicle *v)
|
||||
* Removes an order from all vehicles. Triggers when, say, a station is removed.
|
||||
* @param type The type of the order (OT_GOTO_[STATION|DEPOT|WAYPOINT]).
|
||||
* @param destination The destination. Can be a StationID, DepotID or WaypointID.
|
||||
* @param hangar Only used for airports in the destination.
|
||||
* When false, remove airport and hangar orders.
|
||||
* When true, remove either airport or hangar order.
|
||||
*/
|
||||
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination)
|
||||
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination, bool hangar)
|
||||
{
|
||||
Vehicle *v;
|
||||
|
||||
@@ -1849,7 +1852,7 @@ void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination)
|
||||
Order *order;
|
||||
|
||||
order = &v->current_order;
|
||||
if ((v->type == VEH_AIRCRAFT && order->IsType(OT_GOTO_DEPOT) ? OT_GOTO_STATION : order->GetType()) == type &&
|
||||
if ((v->type == VEH_AIRCRAFT && order->IsType(OT_GOTO_DEPOT) && !hangar ? OT_GOTO_STATION : order->GetType()) == type &&
|
||||
v->current_order.GetDestination() == destination) {
|
||||
order->MakeDummy();
|
||||
SetWindowDirty(WC_VEHICLE_VIEW, v->index);
|
||||
@@ -1863,7 +1866,7 @@ restart:
|
||||
|
||||
OrderType ot = order->GetType();
|
||||
if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue;
|
||||
if (ot == OT_IMPLICIT || (v->type == VEH_AIRCRAFT && ot == OT_GOTO_DEPOT)) ot = OT_GOTO_STATION;
|
||||
if (ot == OT_IMPLICIT || (v->type == VEH_AIRCRAFT && ot == OT_GOTO_DEPOT && !hangar)) ot = OT_GOTO_STATION;
|
||||
if (ot == type && order->GetDestination() == destination) {
|
||||
/* We want to clear implicit orders, but we don't want to make them
|
||||
* dummy orders. They should just vanish. Also check the actual order
|
||||
@@ -1897,7 +1900,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
OrderBackup::RemoveOrder(type, destination);
|
||||
OrderBackup::RemoveOrder(type, destination, hangar);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user