fix(worker): use executeNextTick() return value; keep types/lint clean

GameRunner.executeNextTick(): return false on error paths (never undefined)
Worker loop drains via while (executeNextTick()) instead of separate hasPendingTurns()
Remove stale LocalServer ReplaySpeedMultiplier/MAX_REPLAY_BACKLOG_TURNS imports/constants
undoing part of Spectate catchup #3012
This commit is contained in:
scamiv
2026-02-01 16:12:51 +01:00
parent efb252f94b
commit 44a7839147
3 changed files with 4 additions and 10 deletions
+1 -7
View File
@@ -20,13 +20,7 @@ import {
import { getPersistentID } from "./Auth";
import { LobbyConfig } from "./ClientGameRunner";
import { ReplaySpeedChangeEvent } from "./InputHandler";
import {
defaultReplaySpeedMultiplier,
ReplaySpeedMultiplier,
} from "./utilities/ReplaySpeedMultiplier";
// build a small backlog so MAX can catch up.
const MAX_REPLAY_BACKLOG_TURNS = 60;
import { defaultReplaySpeedMultiplier } from "./utilities/ReplaySpeedMultiplier";
export class LocalServer {
// All turns from the game record on replay.
+1 -1
View File
@@ -145,7 +145,7 @@ export class GameRunner {
console.error("Game tick error:", error);
}
this.isExecuting = false;
return;
return false;
}
if (this.game.inSpawnPhase() && this.game.ticks() % 2 === 0) {
+2 -2
View File
@@ -48,8 +48,8 @@ async function processPendingTurns() {
isProcessingTurns = true;
try {
while (gr.hasPendingTurns()) {
gr.executeNextTick();
while (gr.executeNextTick()) {
// Keep running until no pending turns.
}
} finally {
isProcessingTurns = false;