From 54c45f602874fa7654724e4b3556bc65325d6c05 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 22 Feb 2026 04:32:41 -0800 Subject: [PATCH] reset fix --- game.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/game.ts b/game.ts index fcd9590..336e697 100644 --- a/game.ts +++ b/game.ts @@ -260,7 +260,7 @@ export async function runGame( startRound = lastCompletedRound.num + 1; } - const endRound = startRound + runs - 1; + let endRound = startRound + runs - 1; for (let r = startRound; r <= endRound; r++) { while (state.isPaused) { @@ -268,6 +268,14 @@ export async function runGame( } const roundGeneration = state.generation; + // Reset round counter if generation changed (e.g. admin reset) + const latest = state.completed.at(-1); + const expectedR = latest ? latest.num + 1 : 1; + if (r !== expectedR) { + r = expectedR; + endRound = r + runs - 1; + } + const shuffled = shuffle([...MODELS]); const prompter = shuffled[0]!; const contA = shuffled[1]!;