diff --git a/src/client/LocalServer.ts b/src/client/LocalServer.ts index fdb478034..91dc5dec9 100644 --- a/src/client/LocalServer.ts +++ b/src/client/LocalServer.ts @@ -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. diff --git a/src/core/GameRunner.ts b/src/core/GameRunner.ts index 13e04ea12..416b084c7 100644 --- a/src/core/GameRunner.ts +++ b/src/core/GameRunner.ts @@ -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) { diff --git a/src/core/worker/Worker.worker.ts b/src/core/worker/Worker.worker.ts index 78c3d3517..d89ac03bb 100644 --- a/src/core/worker/Worker.worker.ts +++ b/src/core/worker/Worker.worker.ts @@ -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;