fix: reset game status to playing when changing variant after finished state

This commit is contained in:
2025-08-07 23:54:52 -06:00
parent f89331a3db
commit 305f19c7b0

View File

@@ -17,6 +17,10 @@ export class GameRoom extends Room<GameState> {
// Reset to round 1 and clear decisions when variant changes // Reset to round 1 and clear decisions when variant changes
this.state.currentRound = 1; this.state.currentRound = 1;
this.state.resetRound(); this.state.resetRound();
// Reset game status if it was finished
if (this.state.gameStatus === GameStatus.FINISHED) {
this.state.gameStatus = GameStatus.PLAYING;
}
// G2: Force offer by default // G2: Force offer by default
if (variant === 'G2') { if (variant === 'G2') {
this.state.forcedByP2 = true; this.state.forcedByP2 = true;