Skip to content

Commit

Permalink
never mind, this one WORKS, i tested this time
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Apr 25, 2024
1 parent 3aecda0 commit 6a5fec5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fast64_internal/sm64/animation/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ class SM64_AnimPair:
offset: int = 0

def clean_frames(self):
if len(self.values) <= 1:
if not self.values:
self.values = [0]
return

last_value = self.values[-1]
for i, value in enumerate(reversed(self.values)):
for i, value in enumerate(reversed(self.values[:-1])):
if value != last_value:
break
self.values = self.values[: (-i if i > 1 else len(self.values))]
pass
if i > 1:
self.values = self.values[:-i]
return
else:
self.values = self.values[:1]

def get_frame(self, frame: int):
return self.values[frame] if frame < len(self.values) else self.values[-1]
Expand Down

0 comments on commit 6a5fec5

Please sign in to comment.