diff --git a/src/rooms/commands/BeginGameCommand.ts b/src/rooms/commands/BeginGameCommand.ts index 5053eb3..87e5531 100644 --- a/src/rooms/commands/BeginGameCommand.ts +++ b/src/rooms/commands/BeginGameCommand.ts @@ -63,7 +63,7 @@ export class BeginGameCommand extends Command { const cardChangeTime = new GameEnv().cardChangeTime await this.delay(cardChangeTime * 1000) if (this.state.gameState == GameStateConst.STATE_CHANGE_CARD) { - if (this.state.mode === 4) { + if (this.state.mode !== 4) { return [new NextTurnCommand()] } else { return [new DiceNextTurnCommand()] diff --git a/src/rooms/commands/DiceNextTurnCommand.ts b/src/rooms/commands/DiceNextTurnCommand.ts index 99a33bb..3d0900b 100644 --- a/src/rooms/commands/DiceNextTurnCommand.ts +++ b/src/rooms/commands/DiceNextTurnCommand.ts @@ -5,6 +5,9 @@ import { DiceDrawCommand } from './DiceDrawCommand' export class DiceNextTurnCommand extends Command { async execute() { + if (this.state.round == undefined) { + this.state.round = 0 + } this.state.round += 1 this.state.updateGameState(GameStateConst.STATE_DICE_TURN) for (let [,player] of this.state.players) {