From: Benjamin Auder Date: Thu, 2 Jun 2022 19:01:10 +0000 (+0200) Subject: Maybe we can finally get rid of these code bits which shouldn't be required ? X-Git-Url: https://git.auder.net/doc/html/pieces/%7B%7B%20asset%28%27mixstore/images/index.css?a=commitdiff_plain;h=f77da909dea9da0992a23a92b48d8f08703b4f72;p=xogo.git Maybe we can finally get rid of these code bits which shouldn't be required ? --- 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";