StateBase: More accurate way to check rearming

This commit is contained in:
dnqbob
2023-09-10 18:50:41 +08:00
committed by Gustas
parent 5d2f2bdd1d
commit 38ed21edd2

View File

@@ -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<Resupply>().Any() || a.CurrentActivity.ActivitiesImplementing<ReturnToBase>().Any());
}
protected static bool FullAmmo(IEnumerable<AmmoPool> ammoPools)