Fix games rendering
[vchess.git] / client / src / variants / Magnetic.js
index c2201d6..4549e84 100644 (file)
@@ -136,8 +136,9 @@ export const VariantRules = class MagneticRules extends ChessRules {
     return true; //TODO: is it right?
   }
 
-  underCheck() {
-    return false; //there is no check
+  filterValid(moves) {
+    // There are no checks
+    return moves;
   }
 
   getCheckSquares() {
@@ -189,7 +190,7 @@ export const VariantRules = class MagneticRules extends ChessRules {
     const color = this.turn;
     const kp = this.kingPos[color];
     if (kp[0] < 0)
-      //king disappeared
+      // King disappeared
       return color == "w" ? "0-1" : "1-0";
     if (this.atLeastOneMove())
       // game not over
@@ -200,4 +201,8 @@ export const VariantRules = class MagneticRules extends ChessRules {
   static get THRESHOLD_MATE() {
     return 500; //checkmates evals may be slightly below 1000
   }
+
+  static get SEARCH_DEPTH() {
+    return 2;
+  }
 };