From ed36bc03711787c90018c6fa14d92c857729a1f7 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 30 Mar 2021 15:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9Cstate.round=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?,=20=E9=82=A3=E4=B9=88=E8=AE=BE=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/commands/BeginGameCommand.ts | 2 +- src/rooms/commands/DiceNextTurnCommand.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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) {