Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Chakart.js
index 14e64b5..0042bf1 100644 (file)
@@ -1018,7 +1018,11 @@ export class ChakartRules extends ChessRules {
     if (move.end.effect == "toadette") this.reserve = this.captured;
     else this.reserve = undefined;
     const color = move.turn[0];
-    if (move.vanish.length == 2 && move.vanish[1].c != 'a') {
+    if (
+      move.vanish.length == 2 &&
+      move.vanish[1].c != 'a' &&
+      move.appear.length == 1 //avoid king Boo!
+    ) {
       // Capture: update this.captured
       let capturedPiece = move.vanish[1].p;
       if (capturedPiece == V.INVISIBLE_QUEEN) capturedPiece = V.QUEEN;
@@ -1145,9 +1149,9 @@ export class ChakartRules extends ChessRules {
     return "*";
   }
 
-  static GenRandInitFen(randomness) {
+  static GenRandInitFen(options) {
     return (
-      SuicideRules.GenRandInitFen(randomness).slice(0, -1) +
+      SuicideRules.GenRandInitFen(options).slice(0, -1) +
       // Add Peach + Mario flags + capture counts
       "1111 000000000000"
     );