X-Git-Url: https://git.auder.net/pieces/Cwda/n_white_knight.svg?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPacosako.js;h=218980c440e25a357d4807c43974ebae8865d327;hb=afcfb85255ee152e3d6bced74260f586ced0f3e8;hp=cde503977b372bfb3addc8b40dd02fd09bb2fdd1;hpb=8ec71052706a106ea3d04316d7f76a48aff98bec;p=vchess.git diff --git a/client/src/variants/Pacosako.js b/client/src/variants/Pacosako.js index cde50397..218980c4 100644 --- a/client/src/variants/Pacosako.js +++ b/client/src/variants/Pacosako.js @@ -833,6 +833,7 @@ export class PacosakoRules extends ChessRules { for (let i = mvArray.length - 1; i >= 0; i--) this.undo(mvArray[i]); if (!mv.end.released) return (mvArray.length > 1 ? mvArray : mvArray[0]); } + return null; //never reached } // NOTE: evalPosition() is wrong, but unused since bot plays at random @@ -870,8 +871,13 @@ export class PacosakoRules extends ChessRules { // Add potential promotion indications: const firstLastRank = (c == 'w' ? [7, 0] : [0, 7]); if (move.end.x == firstLastRank[1] && piece == V.PAWN) { - const up = this.getUnionPieces(move.appear[0].c, move.appear[0].p); - notation += "=" + up[c].toUpperCase(); + notation += "="; + if (ChessRules.PIECES.includes(move.appear[0].p)) + notation += move.appear[0].p.toUpperCase(); + else { + const up = this.getUnionPieces(move.appear[0].c, move.appear[0].p); + notation += up[c].toUpperCase(); + } } else if ( move.end.x == firstLastRank[0] &&