X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=base_rules.js;h=0d7b703f2de907ad08f7aff0af360f5c4d5d279f;hp=f73700b844571d8ced5f42ef79fb914292c2e3dd;hb=f77da909dea9da0992a23a92b48d8f08703b4f72;hpb=c4e9bb928964d723ee624a449c3342e2ef9140f8 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";