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

@@ -32,8 +32,7 @@ namespace OpenRA.Mods.RA
if (IsLeaping) return;
var weapon = self.Trait<AttackBase>().Weapons[0].Info;
if (weapon.Range * Game.CellSize * weapon.Range * Game.CellSize
< (target.CenterLocation - self.CenterLocation).LengthSquared) return;
if( !Combat.IsInRange( self.CenterLocation, weapon.Range, target.Actor ) ) return;
self.CancelActivity();
self.QueueActivity(new Leap(self, target));