Add ActorsHavingTrait<TTrait>([Func<TTrait, bool])

This commit is contained in:
atlimit8
2015-10-25 04:45:53 -05:00
parent 0997f5b52f
commit b6f17df260
27 changed files with 132 additions and 125 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Activities
public Hunt(Actor self)
{
var attack = self.Trait<AttackBase>();
targets = self.World.ActorsWithTrait<Huntable>().Select(p => p.Actor).Where(
targets = self.World.ActorsHavingTrait<Huntable>().Where(
a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
&& IsTargetable(a, self) && attack.HasAnyValidWeapons(Target.FromActor(a)));
}