StateBase: More accurate way to check rearming
This commit is contained in:
@@ -106,21 +106,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
|||||||
|
|
||||||
protected static bool IsRearming(Actor a)
|
protected static bool IsRearming(Actor a)
|
||||||
{
|
{
|
||||||
if (a.IsIdle)
|
return !a.IsIdle && (a.CurrentActivity.ActivitiesImplementing<Resupply>().Any() || a.CurrentActivity.ActivitiesImplementing<ReturnToBase>().Any());
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static bool FullAmmo(IEnumerable<AmmoPool> ammoPools)
|
protected static bool FullAmmo(IEnumerable<AmmoPool> ammoPools)
|
||||||
|
|||||||
Reference in New Issue
Block a user