X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCrazyhouse.js;h=eabdd49343d155b5645942a2ecc15061123c5cf4;hp=56e65412c458b037e4c58e16c940fb2f5c38e640;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Crazyhouse.js b/client/src/variants/Crazyhouse.js index 56e65412..eabdd493 100644 --- a/client/src/variants/Crazyhouse.js +++ b/client/src/variants/Crazyhouse.js @@ -38,8 +38,8 @@ export class CrazyhouseRules extends ChessRules { ); } - static GenRandInitFen(randomness) { - return ChessRules.GenRandInitFen(randomness) + " 0000000000 -"; + static GenRandInitFen(options) { + return ChessRules.GenRandInitFen(options) + " 0000000000 -"; } getFen() { @@ -237,11 +237,13 @@ export class CrazyhouseRules extends ChessRules { if (move.vanish.length > 0) return super.getNotation(move); // Rebirth: let piece = move.appear[0].p; - if (ChessRules.PIECES.includes(piece)) { - if (move.appear[0].p != V.PAWN) piece = move.appear[0].p.toUpperCase(); + let prefix = ""; + const endNotation = "@" + V.CoordsToSquare(move.end); + if (piece != V.PAWN) { + if (ChessRules.PIECES.includes(piece)) prefix = piece.toUpperCase(); + else piece = V.PromotionMap[piece].toUpperCase(); } - else piece = V.PromotionMap[piece].toUpperCase(); - return piece + "@" + V.CoordsToSquare(move.end); + return prefix + endNotation; } };