X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate1.js;h=d07cf84767365da141bf0544f18fe8a797f0df78;hb=fd7295e824c0199ad5a1ea40ec4b1f0630a5d806;hp=3d843005709c12760f52ee4aa9b57a57d5c3d085;hpb=a68362420a3a92099dfaacea10f6cbd579161183;p=vchess.git diff --git a/client/src/variants/Allmate1.js b/client/src/variants/Allmate1.js index 3d843005..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) { @@ -203,8 +208,7 @@ export class Allmate1Rules extends ChessRules { if (kp[0] < 0) // King disappeared return color == "w" ? "0-1" : "1-0"; - if (this.atLeastOneMove()) - return "*"; + if (this.atLeastOneMove()) return "*"; // Kings still there, no moves: return "1/2"; }