Fix Vchess variant
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 22 Jul 2020 22:15:53 +0000 (00:15 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 22 Jul 2020 22:15:53 +0000 (00:15 +0200)
client/src/variants/Vchess.js

index 8b59c86..c11cce4 100644 (file)
@@ -9,6 +9,16 @@ export class VchessRules extends ChessRules {
     );
   }
 
+  isAttackedByPawn(sq, color) {
+    return this.isAttackedBySlideNJump(
+      sq,
+      color,
+      V.PAWN,
+      V.steps[V.BISHOP],
+      "oneStep"
+    );
+  }
+
   getNotation(move) {
     let notation = super.getNotation(move);
     // If pawn captures backward, add an indication 'b'