From 436bef6efbe269a48cd865159d12a3b979320754 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 7 Feb 2021 18:23:19 -0500 Subject: [PATCH] Only highlight checked king --- 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 44a490ba..3139c656 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -274,7 +274,7 @@ module.exports = class ChessCommand extends Command { const parsed = this.pickImage(piece); const img = this.images[parsed.color][parsed.name]; const { x, y, width, height } = centerImagePart(img, 62, 62, w, h); - if ((gameState.check || gameState.checkMate) && piece.toUpperCase() === 'K') { + if ((gameState.check || gameState.checkMate) && piece === gameState.turn === 'white' ? 'K' : 'k') { ctx.fillStyle = 'red'; ctx.globalAlpha = 0.5; ctx.fillRect(w, h, 62, 62);