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 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>();
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user