X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FLoser.js;h=9ae2e7fc299c63f7cdff04bf6a93ed39d3a198c4;hp=936c2590254cce5f1a764fe14a71e1909f098e14;hb=9234226104764b91df9d677fb360ad538b98510c;hpb=794b8a9863358c4572726c0d89704271efcf2527 diff --git a/public/javascripts/variants/Loser.js b/public/javascripts/variants/Loser.js index 936c2590..9ae2e7fc 100644 --- a/public/javascripts/variants/Loser.js +++ b/public/javascripts/variants/Loser.js @@ -24,15 +24,20 @@ class LoserRules extends ChessRules const lastRank = (color == "w" ? 0 : sizeX-1); if (x+shift == lastRank) { - let p = V.KING; // Normal move if (this.board[x+shift][y] == V.EMPTY) - moves.push(this.getBasicMove([x,y], [x+shift,y], {c:color,p:p})); + moves.push(this.getBasicMove([x,y], [x+shift,y], {c:color,p:V.KING})); // Captures - if (y>0 && this.canTake([x,y], [x+shift,y-1]) && this.board[x+shift][y-1] != V.EMPTY) - moves.push(this.getBasicMove([x,y], [x+shift,y-1], {c:color,p:p})); - if (y0 && this.canTake([x,y], [x+shift,y-1]) + && this.board[x+shift][y-1] != V.EMPTY) + { + moves.push(this.getBasicMove([x,y], [x+shift,y-1], {c:color,p:V.KING})); + } + if (y