fix: QTE false race condition + restore auto-save slot in menu
- QTESystem: add if (!this.active) return guard in setInterval/setTimeout callbacks to prevent false result from firing after successful key press - SaveLoadMenu: restore auto-save slot 0 row with blue styling, thumbnail, scene label, and read-only load button
This commit is contained in:
@@ -37,6 +37,7 @@ export class QTESystem {
|
||||
document.addEventListener('keydown', this.keyHandler)
|
||||
|
||||
this.timerId = setInterval(() => {
|
||||
if (!this.active) return
|
||||
const elapsed = Date.now() - startTime
|
||||
const remaining = Math.max(0, total - elapsed)
|
||||
onUpdate(remaining / 1000, qte.timeLimit)
|
||||
@@ -47,6 +48,7 @@ export class QTESystem {
|
||||
}, this.tickMs)
|
||||
|
||||
this.timeoutId = setTimeout(() => {
|
||||
if (!this.active) return
|
||||
this.clear()
|
||||
onResult(false)
|
||||
}, total)
|
||||
|
||||
Reference in New Issue
Block a user