From a5c26038df0c504c8259c3bddcaec78d82d29f8a Mon Sep 17 00:00:00 2001 From: Max Cahill <1bardesign@gmail.com> Date: Tue, 7 Jun 2022 16:43:20 +1000 Subject: [PATCH] fixed reset timer still counting as expired --- timer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timer.lua b/timer.lua index e25a958..eb23705 100644 --- a/timer.lua +++ b/timer.lua @@ -22,7 +22,6 @@ function timer:new(time, on_progress, on_finish) self.timer = 0 self.on_progress = on_progress self.on_finish = on_finish - self.has_expired = false self:reset(time) end @@ -58,6 +57,7 @@ end function timer:reset(time) self.timer = 0 self.time = math.max(time or self.time, 1e-6) --negative time not allowed + self.has_expired = false return self end