reset animation object before calling animation function in case the animation function reenables the animation

This commit is contained in:
ohsqueezy 2023-12-28 16:11:35 -08:00
parent 1fff973b46
commit 923c805fe5
2 changed files with 2 additions and 2 deletions

View File

@ -77,11 +77,11 @@ bool Animation::update(float timestamp)
{
overflow = timer.elapsed() - previous_step_time + overflow - _frame_length;
previous_step_time = timer.elapsed();
step();
if (ending)
{
reset();
}
step();
if (overflow > _frame_length)
{
overflow = 0;

View File

@ -2,7 +2,7 @@
____/ \____ /| - Open source game framework licensed to freely use, |
\ / / | copy, modify and sell without restriction |
+--\ ^__^ /--+ | |
| ~/ \~ | | - created for <https://foam.shampoo.ooo> |
| ~/ \~ | | - created for <https://foam.ooo> |
| ~~~~~~~~~~~~ | +------------------------------------------------------+
| SPACE ~~~~~ | /
| ~~~~~~~ BOX |/