Bug fixes
[vchess.git] / client / src / variants / Checkered.js
index fa3a6b7..1e42d99 100644 (file)
@@ -91,7 +91,7 @@ export const VariantRules = class CheckeredRules extends ChessRules {
   }
 
   getEpSquare(moveOrSquare) {
-    if (typeof moveOrSquare !== "object" || move.appear[0].c != 'c')
+    if (typeof moveOrSquare !== "object" || moveOrSquare.appear[0].c != 'c')
       return super.getEpSquare(moveOrSquare);
     // Checkered move: no en-passant
     return undefined;
@@ -279,7 +279,7 @@ export const VariantRules = class CheckeredRules extends ChessRules {
     const oppCol = V.GetOppCol(this.turn);
     for (let i = 0; i < V.size.x; i++) {
       for (let j = 0; j < V.size.y; j++) {
-        // NOTE: just testing == color isn't enough because of checkred pieces
+        // NOTE: just testing == color isn't enough because of checkered pieces
         if (this.board[i][j] != V.EMPTY && this.getColor(i, j) != oppCol) {
           const moves = this.getPotentialMovesFrom([i, j]);
           if (moves.length > 0) {
@@ -414,6 +414,10 @@ export const VariantRules = class CheckeredRules extends ChessRules {
     super.undo(move);
   }
 
+  static get SEARCH_DEPTH() {
+    return 2;
+  }
+
   getNotation(move) {
     if (move.appear.length == 2) {
       // Castle