From f61f52930281a0ad85e97594116f7f7e6906ea36 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 7 Sep 2019 20:46:00 +0200 Subject: [PATCH] fix(assets/animator): make sure that pauseAtEnd works as intended Fixes #37 --- gamecore/modules/assets/animator.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamecore/modules/assets/animator.lua b/gamecore/modules/assets/animator.lua index d788949..53da4e4 100644 --- a/gamecore/modules/assets/animator.lua +++ b/gamecore/modules/assets/animator.lua @@ -60,7 +60,9 @@ function Animator:update(dt) if self.frameTimer > 1 then self.frameTimer = 0 if self.frame == self.animationData.endAt then - self.frame = self.animationData.loop + if not (self.animationData.pauseAtEnd) then + self.frame = self.animationData.loop + end else self.frame = self.frame + 1 end