Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Fullcavalry.js
index 0eb53f1..07951f6 100644 (file)
@@ -88,12 +88,12 @@ export class FullcavalryRules extends ChessRules {
     );
   }
 
-  static GenRandInitFen(randomness) {
-    if (randomness == 0)
+  static GenRandInitFen(options) {
+    if (options.randomness == 0)
       // Deterministic:
-      return "efbqkbnm/pppppppp/8/8/8/8/PPPPPPPP/EDBQKBNM w 0 ahah -";
+      return "enbqkbnm/pppppppp/8/8/8/8/PPPPPPPP/ENBQKBNM w 0 ahah -";
 
-    const baseFen = ChessRules.GenRandInitFen(randomness);
+    const baseFen = ChessRules.GenRandInitFen(options);
     // Replace rooks by lancers with expected orientation:
     const firstBlackRook = baseFen.indexOf('r'),
           lastBlackRook = baseFen.lastIndexOf('r'),
@@ -328,7 +328,7 @@ export class FullcavalryRules extends ChessRules {
 
   filterValid(moves) {
     // At move 1, forbid captures (in case of...):
-    if (this.movesCount >= 2) return moves;
+    if (this.movesCount >= 2) return super.filterValid(moves);
     return moves.filter(m => m.vanish.length == 1);
   }