don't autotarget trees.

This commit is contained in:
Chris Forbes
2009-12-16 11:57:54 +13:00
parent 5112cd2aa1
commit 4a01a911ff
2 changed files with 60 additions and 57 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRa.Game.Traits
{
var inRange = Game.FindUnitsInCircle(self.CenterLocation, Game.CellSize * range);
return inRange.Where(a => a.Owner != self.Owner) /* todo: one day deal with friendly players */
return inRange.Where(a => a.Owner != null && a.Owner != self.Owner) /* todo: one day deal with friendly players */
.OrderBy(a => (a.Location - self.Location).LengthSquared)
.FirstOrDefault();
}