Add Diamond Chess
[vchess.git] / client / src / variants / Berolina.js
index 8473b13..a7f7afa 100644 (file)
@@ -129,15 +129,11 @@ export class BerolinaRules extends ChessRules {
 
   isAttackedByPawn([x, y], color) {
     let pawnShift = (color == "w" ? 1 : -1);
-    if (x + pawnShift >= 0 && x + pawnShift < V.size.x) {
-      if (
-        this.getPiece(x + pawnShift, y) == V.PAWN &&
-        this.getColor(x + pawnShift, y) == color
-      ) {
-        return true;
-      }
-    }
-    return false;
+    return (
+      x + pawnShift >= 0 && x + pawnShift < V.size.x &&
+      this.getPiece(x + pawnShift, y) == V.PAWN &&
+      this.getColor(x + pawnShift, y) == color
+    );
   }
 
   static get SEARCH_DEPTH() {