From 86029606b8615471e440f111e07decc628b74f38 Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:55:34 +0100 Subject: [PATCH] fix(client): ensure turn completion is acknowledged after updates are applied --- src/client/ClientGameRunner.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index 8e5100057..86f7d3e95 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -361,7 +361,6 @@ export class ClientGameRunner { this.stop(); return; } - this.transport.turnComplete(); gu.updates[GameUpdateType.Hash].forEach((hu: HashUpdate) => { this.eventBus.emit(new SendHashEvent(hu.tick, hu.hash)); }); @@ -379,6 +378,11 @@ export class ClientGameRunner { if (gu.updates[GameUpdateType.Win].length > 0) { this.saveGame(gu.updates[GameUpdateType.Win][0]); } + + // In singleplayer/replay (local server), only acknowledge the turn once the + // update has been fully applied and the renderer has ticked. This prevents + // the local server from queuing turns faster than we can process them. + this.transport.turnComplete(); }); const onconnect = () => {