Merge pull request #8988 from reaperrr/fix-moveanim

Fix for WithAttackAnimation breaking WithMoveAnimation
This commit is contained in:
Matthias Mailänder
2015-08-09 21:21:33 +02:00
2 changed files with 6 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
{
if (!string.IsNullOrEmpty(info.AttackSequence))
wsb.PlayCustomAnimation(self, info.AttackSequence);
wsb.PlayCustomAnimation(self, info.AttackSequence, () => wsb.CancelCustomAnimation(self));
}
public void Tick(Actor self)

View File

@@ -95,6 +95,11 @@ namespace OpenRA.Mods.Common.Traits
});
}
public void CancelCustomAnimation(Actor self)
{
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
}
public virtual void DamageStateChanged(Actor self, AttackInfo e)
{
if (DefaultAnimation.CurrentSequence != null)