X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPacosako.js;h=4745f631316d6007389a3a93ecffc7e756c76663;hb=7e98914d2cc787c5d1b1604987a9644b8d4c566f;hp=158abf22823dd8872b7a1cbeb03429c1919f1012;hpb=d982fffc441a0443be90ba6f57a94d1d60b702c8;p=vchess.git diff --git a/client/src/variants/Pacosako.js b/client/src/variants/Pacosako.js index 158abf22..4745f631 100644 --- a/client/src/variants/Pacosako.js +++ b/client/src/variants/Pacosako.js @@ -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);