Skip to content

Commit

Permalink
Fix divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
unitoftime committed Nov 12, 2024
1 parent 95d5b0d commit 3b190db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions render/anim.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func (a *Animation) SetFrame(idx int) {
}

func (a *Animation) GetFrame() Frame {
if len(a.curAnim) <= 0 {
return Frame{}
}
idx := a.frameIdx % len(a.curAnim)
return a.curAnim[idx]
}
Expand Down

0 comments on commit 3b190db

Please sign in to comment.