Almost added TitanChess + EvolutionChess
[vchess.git] / client / src / variants / Swap.js
index 071b21d..9c3407b 100644 (file)
@@ -2,6 +2,7 @@ import { ChessRules, PiPo } from "@/base_rules";
 import { randInt } from "@/utils/alea";
 
 export class SwapRules extends ChessRules {
+
   setOtherVariables(fen) {
     super.setOtherVariables(fen);
     // Local stack of swaps
@@ -34,7 +35,7 @@ export class SwapRules extends ChessRules {
   }
 
   getPPpath(m) {
-    if (m.vanish.length == 1) return super.getPPpath(m);
+    if (m.appear.length == 1) return super.getPPpath(m);
     // Swap promotion:
     return m.appear[1].c + m.appear[1].p;
   }
@@ -341,4 +342,5 @@ export class SwapRules extends ChessRules {
     // Swap
     return "S" + V.CoordsToSquare(move.start) + V.CoordsToSquare(move.end);
   }
+
 };