X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCheckered1.js;fp=client%2Fsrc%2Fvariants%2FCheckered1.js;h=2451f9b50c5e7bed349c43ea8361c545ea5f72a1;hb=5d74fceaa93054b410f469fe6ed4d5a4609bf98d;hp=71f9b920f28e6a5dea0073db3206fcd834b4c689;hpb=5c50b18ebe03fd485ab1e5301a37bec8b14a0ff8;p=vchess.git diff --git a/client/src/variants/Checkered1.js b/client/src/variants/Checkered1.js index 71f9b920..2451f9b5 100644 --- a/client/src/variants/Checkered1.js +++ b/client/src/variants/Checkered1.js @@ -504,9 +504,14 @@ export class Checkered1Rules extends ChessRules { this.kingPos[c][1] = move.appear[0].y; } super.updateCastleFlags(move, piece); - // 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 move turns off a 2-squares pawn flag this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false; + } } this.cmoves.push(this.getCmove(move)); }