From 579623be4764d2971ccd5b93806803c738bb5e4f Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 7 Feb 2021 13:39:56 -0500 Subject: [PATCH] Fix --- commands/games-mp/chess.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index 50392e16..9e0a2f71 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -199,11 +199,11 @@ module.exports = class ChessCommand extends Command { `); } if (fiftyRuleMove > 50) return msg.say('Due to the fifty move rule, this game is a draw.'); + const gameState = game.exportJson(); const winner = gameState.turn === 'black' ? whitePlayer : blackPlayer; if (stalemate) return msg.say('Stalemate! This game is a draw.', { files: [{ attachment: this.displayBoard(gameState, prevPieces), name: 'chess.png' }] }); - const gameState = game.exportJson(); if (!gameState.checkMate) return msg.say('Game ended due to forfeit.'); return msg.say(`Checkmate! Congrats, ${winner}!`, { files: [{ attachment: this.displayBoard(gameState, prevPieces), name: 'chess.png' }]