X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPacosako.js;h=0462d2dbcfda4b4c2d7e1e1da3f9f7975235aab3;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=158abf22823dd8872b7a1cbeb03429c1919f1012;hpb=d982fffc441a0443be90ba6f57a94d1d60b702c8;p=vchess.git diff --git a/client/src/variants/Pacosako.js b/client/src/variants/Pacosako.js index 158abf22..0462d2db 100644 --- a/client/src/variants/Pacosako.js +++ b/client/src/variants/Pacosako.js @@ -199,9 +199,9 @@ export class PacosakoRules extends ChessRules { ); } - static GenRandInitFen(randomness) { + static GenRandInitFen(options) { // Add 16 pawns flags + empty umove: - return ChessRules.GenRandInitFen(randomness) + return ChessRules.GenRandInitFen(options) .slice(0, -2) + "1111111111111111 - -"; } @@ -372,7 +372,7 @@ export class PacosakoRules extends ChessRules { } let baseMoves = []; const c = this.turn; - switch (piece || this.getPiece(x, y)) { + switch (piece) { case V.PAWN: { const firstRank = (c == 'w' ? 7 : 0); baseMoves = this.getPotentialPawnMoves([x, y]).filter(m => { @@ -768,8 +768,8 @@ export class PacosakoRules extends ChessRules { // NOTE: lm.p != V.KING, always. const piece = !!lm - ? lm.p : - this.getPiece(move.vanish[0].x, move.vanish[0].y); + ? lm.p + : this.getPiece(move.vanish[0].x, move.vanish[0].y); if (piece == V.KING) this.kingPos[c] = [move.appear[0].x, move.appear[0].y]; this.updateCastleFlags(move, piece);