Add Knightrelay1. Some fixes. Move odd 'isAttackedBy_multiple_colors' to Checkered...
[vchess.git] / client / src / variants / Berolina.js
index 4cdbb88..ae15095 100644 (file)
@@ -120,16 +120,14 @@ export const VariantRules = class BerolinaRules extends ChessRules {
     return moves;
   }
 
-  isAttackedByPawn([x, y], colors) {
-    for (let c of colors) {
-      let pawnShift = c == "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) == c
-        ) {
-          return true;
-        }
+  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;