Attack activities use armaments directly through constructor

This commit is contained in:
atlimit8
2015-06-27 13:52:00 -05:00
parent cdd4590ece
commit 527675db8d
4 changed files with 7 additions and 7 deletions

View File

@@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.Activities
readonly WDist maxRange; readonly WDist maxRange;
readonly IPositionable positionable; readonly IPositionable positionable;
public Attack(Actor self, Target target, WDist minRange, WDist maxRange, bool allowMovement) public Attack(Actor self, Target target, Armament armament, bool allowMovement)
{ {
Target = target; Target = target;
this.minRange = minRange; this.minRange = armament.Weapon.MinRange;
this.maxRange = maxRange; this.maxRange = armament.Weapon.Range;
attack = self.Trait<AttackBase>(); attack = self.Trait<AttackBase>();
facing = self.Trait<IFacing>(); facing = self.Trait<IFacing>();

View File

@@ -16,8 +16,8 @@ namespace OpenRA.Mods.Common.Activities
{ {
public class Heal : Attack public class Heal : Attack
{ {
public Heal(Actor self, Target target, WDist minRange, WDist maxRange, bool allowMovement) public Heal(Actor self, Target target, Armament armament, bool allowMovement)
: base(self, target, minRange, maxRange, allowMovement) { } : base(self, target, armament, allowMovement) { }
protected override Activity InnerTick(Actor self, AttackBase attack) protected override Activity InnerTick(Actor self, AttackBase attack)
{ {

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
if (a == null) if (a == null)
return null; return null;
return new Activities.Attack(self, newTarget, a.Weapon.MinRange, a.Weapon.Range, allowMove); return new Activities.Attack(self, newTarget, a, allowMove);
} }
} }
} }

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits
if (a == null) if (a == null)
return null; return null;
return new Activities.Heal(self, newTarget, a.Weapon.MinRange, a.Weapon.Range, allowMove); return new Activities.Heal(self, newTarget, a, allowMove);
} }
} }
} }