From 565a4378a5f6f21e9ac29beabf7ceb516c95c84d Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 23 Jan 2021 16:16:15 -0500 Subject: [PATCH] Fix --- commands/games-mp/chess.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index de8ac599..222687ca 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -133,13 +133,13 @@ module.exports = class ChessCommand extends Command { const prevGamePiece = prevGameState ? prevGameState.pieces[`${cols[col]}${row}`] : null; if (piece) { const parsed = this.pickImage(piece); - if (prevGameState && prevGamePiece !== piece && !prevGamePiece) { - drawImageWithTint(ctx, 'green', this.images[parsed.color][parsed.name], w, h, 52, 52); + if (prevGameState && !prevGamePiece) { + drawImageWithTint(ctx, this.images[parsed.color][parsed.name], 'green', w, h, 52, 52); } else { ctx.drawImage(this.images[parsed.color][parsed.name], w, h, 52, 52); } } - if (prevGameState && prevGamePiece !== piece && !piece) { + if (prevGameState && !piece) { ctx.fillStyle = 'green'; ctx.globalAlpha = 0.5; ctx.fillRect(w, h, 52, 52);