X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate2.js;h=9b60a5f6d7072a2755eaf7a21baf800d1a41a3cb;hb=0eebb0df047580d3f66c3bb2dcdce073b3802e62;hp=424bb09e8e635c915c68829175c8588eb7d8fb5a;hpb=8a9ed886b3e551e9179fce924349b6552ba574e7;p=vchess.git diff --git a/client/src/variants/Allmate2.js b/client/src/variants/Allmate2.js index 424bb09e..9b60a5f6 100644 --- a/client/src/variants/Allmate2.js +++ b/client/src/variants/Allmate2.js @@ -70,7 +70,7 @@ export class Allmate2Rules extends ChessRules { break; } for (let om of oppMoves) { - if (om.vanish.length == 2 && om.appear.length == 1) + if (om.vanish.length == 2) // Skip captures: forbidden in this mode continue; V.PlayOnBoard(this.board, om); @@ -90,6 +90,7 @@ export class Allmate2Rules extends ChessRules { } } } + this.undo(m); // 3) Add mate-captures: Object.values(attacked).forEach(sq => { @@ -100,8 +101,6 @@ export class Allmate2Rules extends ChessRules { p: this.getPiece(sq[0], sq[1]) })); }); - - this.undo(m); }); return moves;