Add Colorbound Clobberers (R. Betza)
[vchess.git] / client / src / variants / Capture.js
index f0782a6..19ce734 100644 (file)
@@ -6,7 +6,7 @@ export class CaptureRules extends ChessRules {
     return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1);
   }
 
-       // Stop at the first capture found (if any)
+  // Stop at the first capture found (if any)
   atLeastOneCapture() {
     const color = this.turn;
     const oppCol = V.GetOppCol(color);
@@ -36,11 +36,8 @@ export class CaptureRules extends ChessRules {
 
   getAllValidMoves() {
     const moves = super.getAllValidMoves();
-    if (moves.some(m => m.vanish.length == 2)) return V.KeepCaptures(moves);
+    if (moves.some(m => m.vanish.length == 2 && m.appear.length == 1))
+      return V.KeepCaptures(moves);
     return moves;
   }
-
-  static get SEARCH_DEPTH() {
-    return 4;
-  }
 };