Merge pull request #10141 from reaperrr/fix-anim-cancel

Fix actors not going back to idle animation after custom animation
This commit is contained in:
abcdefg30
2015-12-07 15:13:00 +01:00
7 changed files with 7 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
if (--ticks <= 0)
{
if (!(info.PauseOnLowPower && self.IsDisabled()))
wsb.PlayCustomAnimation(self, info.Sequence);
wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self));
ticks = info.Interval;
}
}

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
public void Charging(Actor self, Target target)
{
wsb.PlayCustomAnimation(self, info.ChargeSequence);
wsb.PlayCustomAnimation(self, info.ChargeSequence, () => wsb.CancelCustomAnimation(self));
}
}
}

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
{
var spriteBody = host.TraitOrDefault<WithSpriteBody>();
if (spriteBody != null && !(info.PauseOnLowPower && self.IsDisabled()))
spriteBody.PlayCustomAnimation(host, info.Sequence);
spriteBody.PlayCustomAnimation(host, info.Sequence, () => spriteBody.CancelCustomAnimation(self));
}
}
}