Use Target range checks in attack activities.

This commit is contained in:
Paul Chote
2013-07-06 15:25:13 +12:00
parent 399aac7e0f
commit 6f67602d57
12 changed files with 39 additions and 39 deletions

View File

@@ -29,10 +29,13 @@ namespace OpenRA.Mods.RA
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove)
{
var weapon = ChooseArmamentForTarget(newTarget);
if (weapon == null)
var a = ChooseArmamentForTarget(newTarget);
if (a == null)
return null;
return new Activities.Heal(newTarget, Math.Max(0, (int)weapon.Weapon.Range), allowMove);
// TODO: Define weapon ranges as WRange
var range = new WRange(Math.Max(0,(int)(1024*a.Weapon.Range)));
return new Activities.Heal(newTarget, range, allowMove);
}
}
}