Attack activities use armaments directly through constructor
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user