mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-09 18:21:48 +00:00
fixed reset timer still counting as expired
This commit is contained in:
parent
bff54f0dbd
commit
a5c26038df
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user