Fix games rendering
[vchess.git] / client / src / variants / Allmate1.js
index bf8f1be..43062a3 100644 (file)
@@ -10,8 +10,8 @@ export const VariantRules = class Allmate1Rules extends ChessRules {
     return [];
   }
 
-  static GenRandInitFen() {
-    return ChessRules.GenRandInitFen().replace(/ -$/, "");
+  static GenRandInitFen(randomness) {
+    return ChessRules.GenRandInitFen(randomness).replace(/ -$/, "");
   }
 
   getPotentialMovesFrom([x, y]) {
@@ -284,14 +284,14 @@ export const VariantRules = class Allmate1Rules extends ChessRules {
   }
 
   static get SEARCH_DEPTH() {
-    return 2;
+    return 1;
   }
 
   getNotation(move) {
     let notation = super.getNotation(move);
     // Add a capture mark (not describing what is captured...):
     if (move.vanish.length > 1 && move.appear.length == 1) {
-      if (notation.match(/^[a-h]x/))
+      if (!!(notation.match(/^[a-h]x/)))
         // Pawn capture: remove initial "b" in bxc4 for example
         notation = notation.substr(1);
       notation = notation.replace("x","") + "X";