reset fix
This commit is contained in:
10
game.ts
10
game.ts
@@ -260,7 +260,7 @@ export async function runGame(
|
|||||||
startRound = lastCompletedRound.num + 1;
|
startRound = lastCompletedRound.num + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const endRound = startRound + runs - 1;
|
let endRound = startRound + runs - 1;
|
||||||
|
|
||||||
for (let r = startRound; r <= endRound; r++) {
|
for (let r = startRound; r <= endRound; r++) {
|
||||||
while (state.isPaused) {
|
while (state.isPaused) {
|
||||||
@@ -268,6 +268,14 @@ export async function runGame(
|
|||||||
}
|
}
|
||||||
const roundGeneration = state.generation;
|
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 shuffled = shuffle([...MODELS]);
|
||||||
const prompter = shuffled[0]!;
|
const prompter = shuffled[0]!;
|
||||||
const contA = shuffled[1]!;
|
const contA = shuffled[1]!;
|
||||||
|
|||||||
Reference in New Issue
Block a user