From: Benjamin Auder Date: Thu, 12 May 2022 15:15:49 +0000 (+0200) Subject: TODO: Cannibal + pawnfall, at least, fail X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/static/current/gitweb.css?a=commitdiff_plain;h=639afc982f9c3be3b4748ef10e8ef771a295712f;p=xogo.git TODO: Cannibal + pawnfall, at least, fail --- diff --git a/base_rules.js b/base_rules.js index e7d58b2..a2cb951 100644 --- a/base_rules.js +++ b/base_rules.js @@ -1347,6 +1347,8 @@ export default class ChessRules { }); } +// TODO: pawnfall + Cannibal issues + pawnPostProcess(moves, color, oppCol) { let moreMoves = []; const lastRank = (color == "w" ? 0 : this.size.x - 1); @@ -2154,6 +2156,10 @@ export default class ChessRules { return; } let movingPiece = this.getDomPiece(move.start.x, move.start.y); + if (!movingPiece) { //TODO this shouldn't be required + callback(); + return; + } const initTransform = movingPiece.style.transform; let chessboard = document.getElementById(this.containerId).querySelector(".chessboard"); diff --git a/variants/Atomic/class.js b/variants/Atomic/class.js index b0662d3..924d222 100644 --- a/variants/Atomic/class.js +++ b/variants/Atomic/class.js @@ -30,7 +30,7 @@ export default class AtomicRules extends ChessRules { canIplay(x, y) { if (this.options["rempawn"] && this.movesCount == 0) - return (this.turn == side && this.getPiece(x, y) == "p"); + return (this.playerColor == this.turn && this.getPiece(x, y) == "p"); return super.canIplay(x, y); }