X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCheckered2.js;h=997c1c7aed1b5cc6adc8df2cf654a66264142a43;hp=9c883f718d937929766f798118a4cca1152b0ddc;hb=5d74fceaa93054b410f469fe6ed4d5a4609bf98d;hpb=5c50b18ebe03fd485ab1e5301a37bec8b14a0ff8 diff --git a/client/src/variants/Checkered2.js b/client/src/variants/Checkered2.js index 9c883f71..997c1c7a 100644 --- a/client/src/variants/Checkered2.js +++ b/client/src/variants/Checkered2.js @@ -351,8 +351,13 @@ export class Checkered2Rules extends ChessRules { postPlay(move) { super.postPlay(move); // Does this move turn off a 2-squares pawn flag? - if ([1, 6].includes(move.start.x) && move.vanish[0].p == V.PAWN) + if ( + [1, 6].includes(move.start.x) && + move.vanish[0].p == V.PAWN && + Math.abs(move.end.x - move.start.x) == 2 + ) { this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false; + } this.cmoves.push(this.getCmove(move)); }