X-Git-Url: https://git.auder.net/pieces/Cwda/c_white_knight.svg?a=blobdiff_plain;f=app.js;h=09d7815ca68518be2b8b5c944b76682ca4214fd3;hb=8f57fbf250093488064401d503f1c621b122e95a;hp=c0c74c0a247a2d8a524b9d37b2a4a9cd44a05616;hpb=535c464b0543306a0ea36c66f07dcfad7a951efc;p=xogo.git diff --git a/app.js b/app.js index c0c74c0..09d7815 100644 --- a/app.js +++ b/app.js @@ -454,7 +454,7 @@ function notifyMe(code) { let curMoves = [], lastFen; -const afterPlay = (move) => { +const afterPlay = (move_s) => { const callbackAfterSend = () => { curMoves = []; const result = vr.getCurrentScore(move); @@ -466,7 +466,12 @@ const afterPlay = (move) => { } }; // Pack into one moves array, then send - curMoves.push(move); + if (Array.isArray(move_s)) + // Array of simple moves (e.g. Chakart) + Array.prototype.push.apply(curMoves, move_s); + else + // Usual case + curMoves.push(move_s); if (vr.turn != playerColor) { toggleTurnIndicator(false); send("newmove", @@ -516,7 +521,7 @@ function initializeGame(obj) { -
`; + `; vr = new V({ seed: obj.seed, //may be null if FEN already exists (running game) fen: obj.fen,