X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBerolina.js;h=a7f7afa7e0605168c208ddcef351e9dd11270710;hp=8473b13ef2e18757105e9a082a24c3c4e824f538;hb=59e74176f5e2e828ce0b81c2ead6f8cdb0654f69;hpb=9415c80ae5f217563565002d5831e0b5acaa6b2b diff --git a/client/src/variants/Berolina.js b/client/src/variants/Berolina.js index 8473b13e..a7f7afa7 100644 --- a/client/src/variants/Berolina.js +++ b/client/src/variants/Berolina.js @@ -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() {