X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=app.js;h=c553ce5abbab6e988d8dd9a0db494da010974bc0;hb=21e8e7122487ae9417c5e7e72c25aa642b7a1226;hp=f89706233b24ef2fb380202f9cc0f59cceb24c7f;hpb=a430bd53ded9c51a741acba820e153da5a138231;p=xogo.git diff --git a/app.js b/app.js index f897062..c553ce5 100644 --- a/app.js +++ b/app.js @@ -328,7 +328,7 @@ const afterPlay = (move) => { //pack into one moves array, then send start: move.start, end: move.end }); - if (vr.turn != color) { + if (vr.turn != playerColor) { toggleTurnIndicator(false); send("newmove", { gid: gid, moves: curMoves, fen: vr.getFen() }); curMoves = []; @@ -354,13 +354,13 @@ const conditionalLoadCSS = (vname) => { } }; -let vr, color; +let vr, playerColor; function initializeGame(obj) { const options = obj.options || {}; import(`/variants/${obj.vname}/class.js`).then(module => { const Rules = module.default; conditionalLoadCSS(obj.vname); - color = (sid == obj.players[0].sid ? "w" : "b"); + playerColor = (sid == obj.players[0].sid ? "w" : "b"); // Init + remove potential extra DOM elements from a previous game: document.getElementById("boardContainer").innerHTML = `
{