X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FGrand.js;h=7248f578cc771952e030db9436675719dae1bd56;hp=4271a6936d5415d386e6ecf105c776275a085f1c;hb=375ecdd1387e729f85ed114e82253469e4849869;hpb=e081ffe361b06ca74db0a36bf72dd73602abf57b diff --git a/public/javascripts/variants/Grand.js b/public/javascripts/variants/Grand.js index 4271a693..7248f578 100644 --- a/public/javascripts/variants/Grand.js +++ b/public/javascripts/variants/Grand.js @@ -218,13 +218,12 @@ class GrandRules extends ChessRules // TODO: some redundant checks if (epsq.x == x+shift && Math.abs(epsq.y - y) == 1) { - let epStep = epsq.y - y; - var enpassantMove = this.getBasicMove([x,y], [x+shift,y+epStep]); + var enpassantMove = this.getBasicMove([x,y], [x+shift,epsq.y]); enpassantMove.vanish.push({ x: x, - y: y+epStep, + y: epsq.y, p: 'p', - c: this.getColor(x,y+epStep) + c: this.getColor(x,epsq.y) }); moves.push(enpassantMove); }