Fix games ordering in MyGames, fix en-passant mistake in Rifle variant
[vchess.git] / client / src / variants / Crazyhouse.js
index 16db148..ff705c7 100644 (file)
@@ -28,6 +28,13 @@ export const VariantRules = class CrazyhouseRules extends ChessRules {
     });
   }
 
+  getEpSquare(moveOrSquare) {
+    if (typeof moveOrSquare !== "object" || move.vanish.length > 0)
+      return super.getEpSquare(moveOrSquare);
+    // Landing move: no en-passant
+    return undefined;
+  }
+
   static GenRandInitFen(randomness) {
     return ChessRules.GenRandInitFen(randomness) + " 0000000000 -";
   }