From 717b8a24f168e84173a9916ba7b60ce1fac78b47 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 31 Mar 2019 23:58:23 +0200 Subject: [PATCH] Fix ReturnToBase restarting on each hotkey press Now that the RTB process is a single activity with childs, it's relatively easy to prevent the activity from restarting every time the deploy/RTB hotkey is pressed. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 75fb8d5065..b3ecb28df5 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -859,6 +859,10 @@ namespace OpenRA.Mods.Common.Traits } else if (order.OrderString == "ReturnToBase" && rearmable != null && rearmable.Info.RearmActors.Any()) { + // Don't restart activity every time deploy hotkey is triggered + if (self.CurrentActivity is ReturnToBase) + return; + if (!order.Queued) UnReserve();