X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate1.js;fp=client%2Fsrc%2Fvariants%2FAllmate1.js;h=d07cf84767365da141bf0544f18fe8a797f0df78;hb=fd7295e824c0199ad5a1ea40ec4b1f0630a5d806;hp=d07474b3ef8e8918a42aeac0f7dad2f12b0a4dcb;hpb=5e38a642ffa0ef5f0076aa0df05aa935b027f649;p=vchess.git diff --git a/client/src/variants/Allmate1.js b/client/src/variants/Allmate1.js index d07474b3..d07cf847 100644 --- a/client/src/variants/Allmate1.js +++ b/client/src/variants/Allmate1.js @@ -60,7 +60,12 @@ export class Allmate1Rules extends ChessRules { oppMoves = this.getPotentialQueenMoves([i, j]); break; case V.KING: - oppMoves = this.getPotentialKingMoves([i, j]); + // Do not allow castling to escape from check + oppMoves = super.getSlideNJumpMoves( + sq, + V.steps[V.ROOK].concat(V.steps[V.BISHOP]), + "oneStep" + ); break; } for (let om of oppMoves) {