X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=eb6214629af473e0e36439efd8a1c6352640ece9;hb=d958cc6847b96a73b73623130b20e44bac9f7cb7;hp=e87827f48e83a86b0bc4032140ef2ef2fd5ab354;hpb=e9b736ee3e72e2ddb9bf4da0c0f1e22a70f7448f;p=vchess.git diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index e87827f4..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; } @@ -290,4 +290,15 @@ export const VariantRules = class BenedictRules extends ChessRules { // Stalemate: return "1/2"; } + + getNotation(move) { + // Just remove flips: + const basicMove = { + appear: [move.appear[0]], + vanish: [move.vanish[0]], + start: move.start, + end: move.end + }; + return super.getNotation(basicMove); + } };