X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FSuction%2Fclass.js;h=e2e36c866ba9bda5d8a51a12b0bbb814bc2f5a17;hb=554e3ad3773a3123701bd894db1df4c1843283b8;hp=db10e58cc4b4acea18d3aa3bdb67b4ae12e5a19f;hpb=fe234391b05ffef5e3236e82ca1391adcb784b45;p=xogo.git diff --git a/variants/Suction/class.js b/variants/Suction/class.js index db10e58..e2e36c8 100644 --- a/variants/Suction/class.js +++ b/variants/Suction/class.js @@ -42,8 +42,8 @@ export default class SuctionRules extends ChessRules { } genRandInitFen(seed) { - const gr = new GiveawayRules( - {mode: "suicide", options: this.options, genFenOnly: true}); + const options = Object.assign({mode: "suicide"}, this.options); + const gr = new GiveawayRules({options: options, genFenOnly: true}); // Add empty cmove: return ( gr.genRandInitFen(seed).slice(0, -17) + '{"enpassant":"-","cmove":"-"}'); @@ -53,7 +53,7 @@ export default class SuctionRules extends ChessRules { const cmoveFen = !this.cmove ? "-" : C.CoordsToSquare(this.cmove.start) + C.CoordsToSquare(this.cmove.end); - return super.getFen().slice(0, -1) + ',"' + cmoveFen + '"}'; + return super.getFen().slice(0, -1) + ',"cmove":"' + cmoveFen + '"}'; } getBasicMove([sx, sy], [ex, ey]) {