add Target overload for IsInRange

This commit is contained in:
Bob
2010-11-04 00:37:13 +13:00
committed by Chris Forbes
parent ecf41722c3
commit a77b7af5fd
4 changed files with 13 additions and 7 deletions

View File

@@ -102,13 +102,10 @@ namespace OpenRA.Mods.RA
if (limitedAmmo != null && !limitedAmmo.HasAmmo())
return;
if( target.IsActor && !Combat.IsInRange( self.CenterLocation, Info.Range, target.Actor ) )
if( !Combat.IsInRange( self.CenterLocation, Info.Range, target ) )
return;
else if( !target.IsActor && !Combat.IsInRange( self.CenterLocation, Info.Range, target.CenterLocation ) )
if( Combat.IsInRange( self.CenterLocation, Info.MinRange, target ) )
return;
if (Info.MinRange * Info.MinRange * Game.CellSize * Game.CellSize >
(target.CenterLocation - self.CenterLocation).LengthSquared) return;
if (!IsValidAgainst(self.World, target)) return;