Fix Pandemonium drop
[vchess.git] / client / src / variants / Pandemonium.js
index 1291eda..496e287 100644 (file)
@@ -14,6 +14,11 @@ export class PandemoniumRules extends ChessRules {
     );
   }
 
+  loseOnRepetition() {
+    // If current side is under check: lost
+    return this.underCheck(this.turn);
+  }
+
   static get GILDING() {
     return "g";
   }
@@ -324,7 +329,7 @@ export class PandemoniumRules extends ChessRules {
       return [];
     }
     // Normal move (after initial setup)
-    if (x >= V.size.x) return this.getReserveMoves(x, y);
+    if (x >= V.size.x) return this.getReserveMoves([x, y]);
     const p = this.getPiece(x, y);
     const sq = [x, y];
     let moves = [];
@@ -604,7 +609,8 @@ export class PandemoniumRules extends ChessRules {
       s: 'n',
       h: 'b',
       w: 'c',
-      a: 'm'
+      a: 'm',
+      g: 'p'
     };
   }