fixed #999 -- replace order/first[ordefault] with .ClosestTo(point)

This commit is contained in:
Chris Forbes
2011-07-08 23:01:05 +12:00
committed by Paul Chote
parent 5c3a6c81ae
commit e44b965785
7 changed files with 18 additions and 18 deletions

View File

@@ -174,8 +174,7 @@ namespace OpenRA.Mods.RA
// TODO exclude other NeutralActor that arent permanent
Actor GetInRange(Actor self)
{
return CaptorsInRange(self).OrderBy(a => (a.CenterLocation - self.CenterLocation).LengthSquared)
.FirstOrDefault();
return CaptorsInRange(self).ClosestTo( self.CenterLocation );
}
int CountPlayersNear(Actor self, Player ignoreMe)