From d9b31cca71159c5befb3621565cc6ebc9724e549 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 7 Feb 2021 14:37:51 -0500 Subject: [PATCH] Clean up --- commands/games-mp/chess.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index 5ac79371..ff4929b6 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -235,8 +235,10 @@ module.exports = class ChessCommand extends Command { if (this.pickImage(gameState.pieces[piece]).color !== gameState.turn) return false; if (gameState.pieces[piece].toUpperCase() !== initial) return false; if (move[2] && move[2] !== 'X' && !piece.startsWith(move[2])) return false; - if (move[4] && !piece.endsWith(gameState.turn === 'black' ? '2' : '7')) return false; - if (move[4] && gameState.pieces[piece].toUpperCase() !== 'P') return false; + if (move[4]) { + if (!piece.endsWith(gameState.turn === 'black' ? '2' : '7')) return false; + if (gameState.pieces[piece].toUpperCase() !== 'P') return false; + } if (!moves[piece]) return false; return moves[piece].includes(move[3]); });