X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=app.js;h=bb1653789337d5e8f4cb8a2e280eea2b71d3d6e7;hb=cc9fe4f154ec244cbec468d1a3b5845e56cb378d;hp=79aa6e0afab7f3470bdee7defe240cfce2d77844;hpb=c4e9bb928964d723ee624a449c3342e2ef9140f8;p=xogo.git diff --git a/app.js b/app.js index 79aa6e0..bb16537 100644 --- a/app.js +++ b/app.js @@ -454,10 +454,10 @@ function notifyMe(code) { let curMoves = [], lastFen; -const afterPlay = (move) => { +const afterPlay = (move_s) => { const callbackAfterSend = () => { curMoves = []; - const result = vr.getCurrentScore(move); + const result = vr.getCurrentScore(move_s); if (result != "*") { setTimeout(() => { toggleVisible("gameStopped"); @@ -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",