X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=40d7a0915744bb3f350ebff0c6e91741b30c82a4;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=4ca5292d1d06ca2de174877f8e6b71afb5a0b34f;hpb=bb688df52df0713aba7b2c1c068614544f5ae96d;p=vchess.git diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index 4ca5292d..40d7a091 100644 --- a/client/src/variants/Benedict.js +++ b/client/src/variants/Benedict.js @@ -1,6 +1,7 @@ import { ChessRules, PiPo, Move } from "@/base_rules"; export class BenedictRules extends ChessRules { + static get HasEnpassant() { return false; } @@ -135,13 +136,10 @@ export class BenedictRules extends ChessRules { // Stop at the first move found atLeastOneMove() { const color = this.turn; - const oppCol = V.GetOppCol(color); for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { - if (this.board[i][j] != V.EMPTY && this.getColor(i, j) != oppCol) { - const moves = this.getPotentialMovesFrom([i, j]); - if (moves.length > 0) - return true; + if (this.board[i][j] != V.EMPTY && this.getColor(i, j) == color) { + if (this.getPotentialMovesFrom([i, j]).length > 0) return true; } } } @@ -169,4 +167,5 @@ export class BenedictRules extends ChessRules { }; return super.getNotation(basicMove); } + };