X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate2.js;h=9ba91ef05ab91b00bcf4ec198a85c99e4afbfa67;hp=31d41befad47c3b4f701cc1b543980296b1f0b2f;hb=fd7295e824c0199ad5a1ea40ec4b1f0630a5d806;hpb=5e38a642ffa0ef5f0076aa0df05aa935b027f649 diff --git a/client/src/variants/Allmate2.js b/client/src/variants/Allmate2.js index 31d41bef..9ba91ef0 100644 --- a/client/src/variants/Allmate2.js +++ b/client/src/variants/Allmate2.js @@ -61,7 +61,12 @@ export class Allmate2Rules 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) {