Something went wrong. Try again.
A WebGPU retro game engine for TypeScript, inspired by RetroBlit. Build pixel-perfect 2D games with a clean, fantasy-console-style API.
Something went wrong. Try again.
fix(utils): prevent timer lock on hard tick-counter rewind master
When lastFiredTick is well ahead of currentTick (e.g. after a global reset to 0), elapsedTicks() clamped to 0 but the old baseline was never cleared. The timer would lock until currentTick reached lastFiredTick + intervalTicks. Add an explicit guard at the top of tick(): if currentTick < lastFiredTick, reset the baseline to currentTick and return false. The timer then fires again after exactly intervalTicks from the rewound position. Splits the shallow-rewind test and adds a dedicated hard-rewind regression test (lastFiredTick=1000, rewind to 0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Vaclav Vancura <commit@vancura.dev>
Author Vaclav Vancura Co-author Claude Sonnet 4.6 Date (May 9, 2026, 7:23 AM UTC) Commit ba776fc0 ba776fc03f9a0bc671a3ef18018a2f3b38a21b5e Parent 93ce0e58 93ce0e5832c035e5ce8b7af601069a8321f64bb8