From c1da0a9f44889cd845a3c023629bf47624a84414 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Sun, 31 Dec 2023 11:08:56 +0000 Subject: [PATCH] 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. --- src/order_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 2650843c1f..48abae1fb0 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -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();