X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=app.js;h=09d7815ca68518be2b8b5c944b76682ca4214fd3;hb=8f57fbf250093488064401d503f1c621b122e95a;hp=79aa6e0afab7f3470bdee7defe240cfce2d77844;hpb=f382c57bf08425c170479e55b8670efaf3a7a548;p=xogo.git diff --git a/app.js b/app.js index 79aa6e0..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",