From 527675db8d1fa0b035d554d80e606e79134f221d Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Sat, 27 Jun 2015 13:52:00 -0500 Subject: [PATCH] Attack activities use armaments directly through constructor --- OpenRA.Mods.Common/Activities/Attack.cs | 6 +++--- OpenRA.Mods.Common/Activities/Heal.cs | 4 ++-- OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs | 2 +- OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Attack.cs b/OpenRA.Mods.Common/Activities/Attack.cs index 9036d5fff7..d48334ffea 100644 --- a/OpenRA.Mods.Common/Activities/Attack.cs +++ b/OpenRA.Mods.Common/Activities/Attack.cs @@ -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(); facing = self.Trait(); diff --git a/OpenRA.Mods.Common/Activities/Heal.cs b/OpenRA.Mods.Common/Activities/Heal.cs index d50b485ef8..157dea71ab 100644 --- a/OpenRA.Mods.Common/Activities/Heal.cs +++ b/OpenRA.Mods.Common/Activities/Heal.cs @@ -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) { diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs index 99d7079dd9..b9ce88c635 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs @@ -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); } } } diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs index b0c4aeef0b..89795550d1 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs @@ -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); } } }