From 1e43a8f5903d46c9b7c15c3ef237299f8f9e795f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 20 Feb 2020 03:04:16 +0100 Subject: [PATCH] Minor Aircraft ResolveOrder optimization Streamline RTB if checks. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index b332635995..df3300601d 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -1070,10 +1070,10 @@ namespace OpenRA.Mods.Common.Traits self.CancelActivity(); UnReserve(); } - else if (orderString == "ReturnToBase" && rearmable != null && rearmable.Info.RearmActors.Any()) + else if (orderString == "ReturnToBase") { - // Don't restart activity every time deploy hotkey is triggered - if (self.CurrentActivity is ReturnToBase || GetActorBelow() != null) + // Do nothing if not rearmable and don't restart activity every time deploy hotkey is triggered + if (rearmable == null || !rearmable.Info.RearmActors.Any() || self.CurrentActivity is ReturnToBase || GetActorBelow() != null) return; if (!order.Queued)