X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate1.js;h=f3c0b2ec03c05f217409cef2a96565032e755091;hb=8a9ed886b3e551e9179fce924349b6552ba574e7;hp=d07474b3ef8e8918a42aeac0f7dad2f12b0a4dcb;hpb=bb688df52df0713aba7b2c1c068614544f5ae96d;p=vchess.git diff --git a/client/src/variants/Allmate1.js b/client/src/variants/Allmate1.js index d07474b3..f3c0b2ec 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( + [x, y], + V.steps[V.ROOK].concat(V.steps[V.BISHOP]), + "oneStep" + ); break; } for (let om of oppMoves) {