X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FZen.js;h=7edbe40a6fa8baf0b05b7fecdeb72ae8bd9db1ff;hb=665a8844aa49422692f184703944978510106aa7;hp=808d5436bed14f1db741523a169741bf2e3718dc;hpb=8ca6042e7b8cffd4131e81493141ab6261300ff6;p=vchess.git diff --git a/client/src/variants/Zen.js b/client/src/variants/Zen.js index 808d5436..7edbe40a 100644 --- a/client/src/variants/Zen.js +++ b/client/src/variants/Zen.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class ZenRules extends ChessRules { + getEpSquare(moveOrSquare) { if (!moveOrSquare) return undefined; if (typeof moveOrSquare === "string") { @@ -78,6 +79,7 @@ export class ZenRules extends ChessRules { } if ( V.OnBoard(i, j) && + this.board[i][j] != V.EMPTY && this.getColor(i, j) == oppCol && this.getPiece(i, j) == asA ) { @@ -87,7 +89,8 @@ export class ZenRules extends ChessRules { promotionPieces.forEach(p => { moves.push(this.getBasicMove([x, y], [i, j], { c: color, p: p })); }); - } else { + } + else { // All other cases moves.push(this.getBasicMove([x, y], [i, j])); } @@ -161,4 +164,5 @@ export class ZenRules extends ChessRules { k: 1000 }; } + };