From 38ed21edd22272a879f540521995e170b5253015 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Sun, 10 Sep 2023 18:50:41 +0800 Subject: [PATCH] StateBase: More accurate way to check rearming --- .../Traits/BotModules/Squads/States/StateBase.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/StateBase.cs b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/StateBase.cs index 983f65a052..3c5c23f20a 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/Squads/States/StateBase.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/Squads/States/StateBase.cs @@ -106,21 +106,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads protected static bool IsRearming(Actor a) { - if (a.IsIdle) - return false; - - var activity = a.CurrentActivity; - if (activity.GetType() == typeof(Resupply)) - return true; - - var next = activity.NextActivity; - if (next == null) - return false; - - if (next.GetType() == typeof(Resupply)) - return true; - - return false; + return !a.IsIdle && (a.CurrentActivity.ActivitiesImplementing().Any() || a.CurrentActivity.ActivitiesImplementing().Any()); } protected static bool FullAmmo(IEnumerable ammoPools)