X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCrazyhouse.js;h=179fffa5a91d345173a4e95eac3271c9434aa0c3;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=f36bfcc4aa7ae503edd073864947a5a4892ba37a;hpb=a5d5668613d9a3d04c9a4f8b69122d02b7322137;p=vchess.git diff --git a/public/javascripts/variants/Crazyhouse.js b/public/javascripts/variants/Crazyhouse.js index f36bfcc4..179fffa5 100644 --- a/public/javascripts/variants/Crazyhouse.js +++ b/public/javascripts/variants/Crazyhouse.js @@ -29,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], } ); } @@ -212,7 +212,7 @@ class CrazyhouseRules extends ChessRules super.updateVariables(move); if (move.vanish.length == 2 && move.appear.length == 2) return; //skip castle - const color = this.turn; + const color = move.appear[0].c; if (move.vanish.length == 0) { this.reserve[color][move.appear[0].p]--; @@ -281,5 +281,3 @@ class CrazyhouseRules extends ChessRules return "@" + V.CoordsToSquare(move.end); } } - -const VariantRules = CrazyhouseRules;