From cb9cab9acae49086e0407f69dd32c88028c6e879 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Tue, 9 Jun 2026 19:22:11 -0700 Subject: [PATCH] Keep static spawn timer for singleplayer games MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #4198 made the spawn-phase timer count down numSpawnPhaseTurns(), but singleplayer never adds SpawnTimerExecution (GameRunner.ts), so its spawn phase doesn't end on a timer — it ends when the player spawns. The countdown would tick to 0 at ~10s while the phase kept going. In GameRightSidebar.tick(), restore the old static display (maxTimerValue * 60, or 0 when unset) during spawn phase for Singleplayer games, leaving the countdown for all other game types. Uses an explicit gameType check rather than _isSinglePlayer so replays of multiplayer games still count down. --- src/client/hud/layers/GameRightSidebar.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/hud/layers/GameRightSidebar.ts b/src/client/hud/layers/GameRightSidebar.ts index 88472d718..12bc818fe 100644 --- a/src/client/hud/layers/GameRightSidebar.ts +++ b/src/client/hud/layers/GameRightSidebar.ts @@ -112,6 +112,16 @@ export class GameRightSidebar extends LitElement implements Controller { } if (this.game.inSpawnPhase()) { + // Singleplayer has no spawn timer (SpawnTimerExecution isn't added), so + // the spawn phase doesn't count down — keep the old static display. + if (this.game.config().gameConfig().gameType === GameType.Singleplayer) { + const maxTimerValue = this.game.config().gameConfig().maxTimerValue; + this.timer = + maxTimerValue !== null && maxTimerValue !== undefined + ? maxTimerValue * 60 + : 0; + return; + } const spawnPhaseDurationTicks = this.game.config().numSpawnPhaseTurns(); const currentTicks = this.game.ticks(); const remainingTicks = spawnPhaseDurationTicks - currentTicks;