1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Change: Only remove orders from primary vehicles

There's no need for disaster, effect vehicles, free wagons or aircraft shadows and rotors to be checked for orders.

When a station, waypoint and a depot is removed or when an airport is replaced with another without hangars, remove orders only from primary vehicles.
This commit is contained in:
SamuXarick
2023-12-31 11:08:56 +00:00
parent 934545a674
commit c1da0a9f44

View File

@@ -1747,6 +1747,8 @@ void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination, bool
/* Go through all vehicles */
for (Vehicle *v : Vehicle::Iterate()) {
if (!v->IsPrimaryVehicle()) continue;
if ((v->type == VEH_AIRCRAFT && v->current_order.IsType(OT_GOTO_DEPOT) && !hangar ? OT_GOTO_STATION : v->current_order.GetType()) == type &&
(!hangar || v->type == VEH_AIRCRAFT) && v->current_order.GetDestination() == destination) {
v->current_order.MakeDummy();