diff --git a/apps/client/src/scenes/game/application/GameTimer.ts b/apps/client/src/scenes/game/application/GameTimer.ts index b31d726..5104d44 100644 --- a/apps/client/src/scenes/game/application/GameTimer.ts +++ b/apps/client/src/scenes/game/application/GameTimer.ts @@ -49,7 +49,12 @@ public getRemainingTime(): number { if (!this.gameStartTime) return config.GAME_CONFIG.GAME_DURATION_SEC; - const elapsedMs = this.nowMsProvider() - this.gameStartTime; + const nowMs = this.nowMsProvider(); + if (nowMs < this.gameStartTime) { + return config.GAME_CONFIG.GAME_DURATION_SEC; + } + + const elapsedMs = nowMs - this.gameStartTime; const remainingSec = config.GAME_CONFIG.GAME_DURATION_SEC - elapsedMs / 1000;