From 6e6d3e939b23283d21e63e3a57093da3ab59d86d Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 27 Mar 2021 11:36:59 -0400 Subject: [PATCH] Use setPiece in chess --- commands/games-mp/chess.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index ec1644cc..034dc4fa 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -191,9 +191,7 @@ module.exports = class ChessCommand extends Command { const pawnMoved = gameState.pieces[choice[0]].toUpperCase() === 'P'; game.move(choice[0], choice[1]); if (pawnMoved && choice[1].endsWith(gameState.turn === 'white' ? '8' : '1')) { - game.board.configuration.pieces[choice[1]] = gameState.turn === 'white' - ? choice[2] - : choice[2].toLowerCase(); + game.setPiece(choice[1], gameState.turn === 'white' ? choice[2] : choice[2].toLowerCase()); } } const timeTaken = new Date() - now;