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 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;
this.minRange = minRange;
this.maxRange = maxRange;
this.minRange = armament.Weapon.MinRange;
this.maxRange = armament.Weapon.Range;
attack = self.Trait<AttackBase>();
facing = self.Trait<IFacing>();

View File

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

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
if (a == 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)
return null;
return new Activities.Heal(self, newTarget, a.Weapon.MinRange, a.Weapon.Range, allowMove);
return new Activities.Heal(self, newTarget, a, allowMove);
}
}
}