From f77da909dea9da0992a23a92b48d8f08703b4f72 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Thu, 2 Jun 2022 21:01:10 +0200 Subject: [PATCH] Maybe we can finally get rid of these code bits which shouldn't be required ? --- base_rules.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/base_rules.js b/base_rules.js index f73700b..0d7b703 100644 --- a/base_rules.js +++ b/base_rules.js @@ -2154,9 +2154,7 @@ export default class ChessRules { playVisual(move, r) { move.vanish.forEach(v => { - // TODO: next "if" shouldn't be required - if (this.g_pieces[v.x][v.y]) - this.g_pieces[v.x][v.y].remove(); + this.g_pieces[v.x][v.y].remove(); this.g_pieces[v.x][v.y] = null; }); let chessboard = @@ -2203,10 +2201,6 @@ export default class ChessRules { return; } let initPiece = this.getDomPiece(move.start.x, move.start.y); - if (!initPiece) { //TODO this shouldn't be required - callback(); - return; - } // NOTE: cloning generally not required, but light enough, and simpler let movingPiece = initPiece.cloneNode(); initPiece.style.opacity = "0"; -- 2.44.0