From 639afc982f9c3be3b4748ef10e8ef771a295712f Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Thu, 12 May 2022 17:15:49 +0200
Subject: [PATCH] TODO: Cannibal + pawnfall, at least, fail

---
 base_rules.js            | 6 ++++++
 variants/Atomic/class.js | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

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);
   }
 
-- 
2.44.0