Skip to content

Commit

Permalink
Fix WithSpriteBody repeated custom anim playback
Browse files Browse the repository at this point in the history
PlayCustomAnimationRepeating looping back into itself via Action instead of simply using Animation.PlayRepeating is weird, and in fact results in 1 frame/tick not being played correctly.
This means that on bleed (before this fix) an animation looped via
PlayCustomAnimationRepeating will go out of sync with an anim using
Animation.PlayRepeating, even if both have identical length and Tick
rate.
  • Loading branch information
reaperrr committed Sep 10, 2018
1 parent 5d1c37a commit 4955917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs
Expand Up @@ -104,7 +104,7 @@ public void PlayCustomAnimation(Actor self, string name, Action after = null)
public void PlayCustomAnimationRepeating(Actor self, string name)
{
var sequence = NormalizeSequence(self, name);
DefaultAnimation.PlayThen(sequence, () => PlayCustomAnimationRepeating(self, sequence));
DefaultAnimation.PlayRepeating(NormalizeSequence(self, sequence));
}

public void PlayCustomAnimationBackwards(Actor self, string name, Action after = null)
Expand Down

0 comments on commit 4955917

Please sign in to comment.