X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCrazyhouse.js;h=3d9c743f8dc23bf510ccc4963b184951f8e3c81b;hp=1fff1e919109058117158c743196238bf753c4a3;hb=b6487fb9c41705187cf97215fc9e8f86a59057c7;hpb=fb6ceeff17b53ab049e14d2bee7a61de92ca4762 diff --git a/public/javascripts/variants/Crazyhouse.js b/public/javascripts/variants/Crazyhouse.js index 1fff1e91..3d9c743f 100644 --- a/public/javascripts/variants/Crazyhouse.js +++ b/public/javascripts/variants/Crazyhouse.js @@ -11,10 +11,9 @@ class CrazyhouseRules extends ChessRules // 6) Check promoted array if (!fenParsed.promoted) return false; - fenpromoted = fenParsed.promoted; - if (fenpromoted == "-") + if (fenParsed.promoted == "-") return true; //no promoted piece on board - const squares = fenpromoted.split(","); + const squares = fenParsed.promoted.split(","); for (let square of squares) { const c = V.SquareToCoords(square); @@ -30,8 +29,8 @@ class CrazyhouseRules extends ChessRules return Object.assign( ChessRules.ParseFen(fen), { - reserve: fenParts[4], - promoted: fenParts[5], + reserve: fenParts[5], + promoted: fenParts[6], } ); } @@ -48,8 +47,8 @@ class CrazyhouseRules extends ChessRules getReserveFen() { - let counts = _.map(_.range(10), 0); - for (let i=0; i