X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=eb6214629af473e0e36439efd8a1c6352640ece9;hp=4a31fceb6a7a5f4e105d6d36aa6f4ef1bc93d0e0;hb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;hpb=afbf3ca7151ef15a9e579b0f913683ab212396c4 diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index 4a31fceb..eb621462 100644 --- a/client/src/variants/Benedict.js +++ b/client/src/variants/Benedict.js @@ -152,10 +152,10 @@ export const VariantRules = class BenedictRules extends ChessRules { castleSide < 2; castleSide++ //large, then small ) { - if (!this.castleFlags[c][castleSide]) continue; + if (this.castleFlags[c][castleSide] >= 8) continue; // If this code is reached, rooks and king are on initial position - const rookPos = this.INIT_COL_ROOK[c][castleSide]; + const rookPos = this.castleFlags[c][castleSide]; if (this.getColor(x, rookPos) != c) // Rook is here but changed color continue; @@ -176,7 +176,7 @@ export const VariantRules = class BenedictRules extends ChessRules { // Nothing on the path to the rook? step = castleSide == 0 ? -1 : 1; - for (i = y + step; i != this.INIT_COL_ROOK[c][castleSide]; i += step) { + for (i = y + step; i != rookPos; i += step) { if (this.board[x][i] != V.EMPTY) continue castlingCheck; }