Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Pacosako.js
index 158abf2..0462d2d 100644 (file)
@@ -199,9 +199,9 @@ export class PacosakoRules extends ChessRules {
     );
   }
 
-  static GenRandInitFen(randomness) {
+  static GenRandInitFen(options) {
     // Add 16 pawns flags + empty umove:
-    return ChessRules.GenRandInitFen(randomness)
+    return ChessRules.GenRandInitFen(options)
       .slice(0, -2) + "1111111111111111 - -";
   }
 
@@ -372,7 +372,7 @@ export class PacosakoRules extends ChessRules {
     }
     let baseMoves = [];
     const c = this.turn;
-    switch (piece || this.getPiece(x, y)) {
+    switch (piece) {
       case V.PAWN: {
         const firstRank = (c == 'w' ? 7 : 0);
         baseMoves = this.getPotentialPawnMoves([x, y]).filter(m => {
@@ -768,8 +768,8 @@ export class PacosakoRules extends ChessRules {
     // NOTE: lm.p != V.KING, always.
     const piece =
       !!lm
-        ? lm.p :
-        this.getPiece(move.vanish[0].x, move.vanish[0].y);
+        ? lm.p
+        this.getPiece(move.vanish[0].x, move.vanish[0].y);
     if (piece == V.KING)
       this.kingPos[c] = [move.appear[0].x, move.appear[0].y];
     this.updateCastleFlags(move, piece);