Skip to content

Commit

Permalink
Fix issue where the animation would overshoot the duration by 1
Browse files Browse the repository at this point in the history
  • Loading branch information
RenolY2 committed Jan 26, 2024
1 parent 97bc8f8 commit bde36bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions j3d/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def attach(self,model): #<-?

@property
def is_finished(self):
return self.time == self.duration and self.loop_mode == 0
return self.time == self.duration-1 and self.loop_mode == 0

def advance_frame(self):
self.time += 1
if self.time == self.duration and self.loop_mode == 2:
if self.time == self.duration-1 and self.loop_mode == 2:
self.time = 0
self.update_model()

Expand Down

0 comments on commit bde36bd

Please sign in to comment.