attack if in range of any cell of a building

This commit is contained in:
Bob
2010-11-03 21:06:55 +13:00
committed by Chris Forbes
parent c3fc7b98f3
commit 50b1ba3acc
8 changed files with 56 additions and 7 deletions

View File

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