RA - AppearsFriendlyTo and AppearsHostileTo actor extensions

This commit is contained in:
alzeih
2011-03-13 15:37:24 +13:00
parent cf8cfdc42d
commit f4e4f987be
6 changed files with 56 additions and 4 deletions

View File

@@ -222,7 +222,7 @@ namespace OpenRA.Mods.RA
var inRange = self.World.FindUnitsInCircle(self.CenterLocation, Game.CellSize * range);
return inRange
.Where(a => a.Owner != null && self.Owner.Stances[a.Owner] == Stance.Enemy)
.Where(a => a.Owner != null && a.AppearsHostileTo(self))
.Where(a => !a.HasTrait<AutoTargetIgnore>())
.Where(a => HasAnyValidWeapons(Target.FromActor(a)))
.OrderBy(a => (a.CenterLocation - self.CenterLocation).LengthSquared)