Skip to content

Commit

Permalink
fix: add edge case to loop rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
niceEli committed May 23, 2024
1 parent 7f66965 commit 8d79b33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kaboom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4365,7 +4365,9 @@ export default (gopt: KaboomOpt = {}): KaboomCtx => {
const ev = this.onUpdate(() => {
t += dt();
if (t >= time) {
action();
if (action){
action();
}
t -= time;
if (count != -1 && --count === 0) {
ev.cancel();
Expand Down

0 comments on commit 8d79b33

Please sign in to comment.