From 26a202600d7f19a69421d338e24e743be2957abc Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 5 Jul 2015 00:17:01 +0200 Subject: [PATCH] Make WithAttackAnimation work with WithSpriteBody as well --- .../Traits/Render/WithAttackAnimation.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs index bb9628acdb..12c2dc0e15 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public class WithAttackAnimationInfo : ITraitInfo, Requires, Requires, Requires + public class WithAttackAnimationInfo : ITraitInfo, Requires, Requires, Requires { [Desc("Armament name")] public readonly string Armament = "primary"; @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits readonly WithAttackAnimationInfo info; readonly AttackBase attack; readonly Armament armament; - readonly WithFacingSpriteBody wfsb; + readonly WithSpriteBody wsb; public WithAttackAnimation(ActorInitializer init, WithAttackAnimationInfo info) { @@ -43,13 +43,13 @@ namespace OpenRA.Mods.Common.Traits attack = init.Self.Trait(); armament = init.Self.TraitsImplementing() .Single(a => a.Info.Name == info.Armament); - wfsb = init.Self.Trait(); + wsb = init.Self.Trait(); } public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { if (!string.IsNullOrEmpty(info.AttackSequence)) - wfsb.PlayCustomAnimation(self, info.AttackSequence); + wsb.PlayCustomAnimation(self, info.AttackSequence); } public void Tick(Actor self) @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits if (string.IsNullOrEmpty(info.AimSequence) && string.IsNullOrEmpty(info.ReloadPrefix)) return; - var sequence = wfsb.Info.Sequence; + var sequence = wsb.Info.Sequence; if (!string.IsNullOrEmpty(info.AimSequence) && attack.IsAttacking) sequence = info.AimSequence; @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits if (!string.IsNullOrEmpty(prefix) && sequence != (prefix + sequence)) sequence = prefix + sequence; - wfsb.DefaultAnimation.ReplaceAnim(sequence); + wsb.DefaultAnimation.ReplaceAnim(sequence); } } }