Add ActorsHavingTrait<TTrait>([Func<TTrait, bool])
This commit is contained in:
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Returns an array of actors representing all ground attack units of this player.")]
|
||||
public Actor[] GetGroundAttackers()
|
||||
{
|
||||
return Player.World.ActorsWithTrait<AttackBase>().Select(a => a.Actor)
|
||||
return Player.World.ActorsHavingTrait<AttackBase>()
|
||||
.Where(a => a.Owner == Player && !a.IsDead && a.IsInWorld && a.Info.HasTraitInfo<MobileInfo>())
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user