Fix Xiangqi + a few cosmetics
[vchess.git] / client / src / base_rules.js
index d17ebe6..2c2b705 100644 (file)
@@ -126,6 +126,11 @@ export const ChessRules = class ChessRules {
     return null;
   }
 
+  // In some variants, the player who repeat a position loses
+  static get LoseOnRepetition() {
+    return false;
+  }
+
   // Some variants use click infos:
   doClick() {
     return null;
@@ -969,7 +974,7 @@ export const ChessRules = class ChessRules {
           ],
           vanish: [
             // King might be initially disguised (Titan...)
-            new PiPo({ x: x, y: y, p: this.board[x][y][1], c: c }),
+            new PiPo({ x: x, y: y, p: castlingKing, c: c }),
             new PiPo({ x: x, y: rookPos, p: castlingPiece, c: c })
           ],
           end: