Fix Swap variant
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 3 May 2020 22:39:04 +0000 (00:39 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 3 May 2020 22:39:04 +0000 (00:39 +0200)
client/src/variants/Swap.js

index 071b21d..4d97ae9 100644 (file)
@@ -34,7 +34,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;
   }