X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FWildebeest.js;h=ef3779ad9beee3423ad141b49f4c8b10aad2b047;hb=375ecdd1387e729f85ed114e82253469e4849869;hp=4194521ec98b5cea2ff13b6d809b9cd7f27915e0;hpb=2d7194bd9c976f444e43e5dc0a725823b6472eb9;p=vchess.git diff --git a/public/javascripts/variants/Wildebeest.js b/public/javascripts/variants/Wildebeest.js index 4194521e..ef3779ad 100644 --- a/public/javascripts/variants/Wildebeest.js +++ b/public/javascripts/variants/Wildebeest.js @@ -159,13 +159,12 @@ class WildebeestRules 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); } @@ -281,3 +280,5 @@ class WildebeestRules extends ChessRules " w 1111 -"; } } + +const VariantRules = WildebeestRules;