Skip to content

Commit

Permalink
Fix crash when playing v5 animation with speed but no duration
Browse files Browse the repository at this point in the history
  • Loading branch information
MegAmi24 committed Nov 7, 2024
1 parent a49f8e7 commit 4daa173
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RetroEDv2/tools/animationeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2318,6 +2318,8 @@ void AnimationEditor::ProcessAnimation()
case ENGINE_v5:
animTimer += animFile.animations[currentAnim].speed;
duration = animFile.animations[currentAnim].frames[currentFrame].duration;
if (duration <= 0)
break;
while (animTimer > duration) {
animTimer -= duration;
++currentFrame;
Expand All @@ -2331,6 +2333,8 @@ void AnimationEditor::ProcessAnimation()

duration = animFile.animations[currentAnim].frames[currentFrame].duration;
changed = true;
if (duration <= 0)
break;
}
break;

Expand Down

0 comments on commit 4daa173

Please sign in to comment.