Fix last fix :)
[xogo.git] / app.js
diff --git a/app.js b/app.js
index 7f8dc27..0a1fffe 100644 (file)
--- a/app.js
+++ b/app.js
@@ -103,6 +103,7 @@ function showNewGameForm() {
     toggleVisible("newGameForm");
     import(`/variants/${vname}/class.js`).then(module => {
       window.V = module.default;
+      for (const [k, v] of Object.entries(V.Aliases)) window[k] = v;
       prepareOptions();
     });
   }
@@ -206,6 +207,7 @@ function fillGameInfos(gameInfos, oppIndex) {
         for (let j=i; j<i+4; j++) {
           if (j == options.length) break;
           const opt = options[j];
+          if (!opt[1]) continue;
           htmlContent +=
             '<span class="option">' +
             (opt[1] === true ? opt[0] : `${opt[0]}:${opt[1]}`) + " " +
@@ -428,12 +430,7 @@ const afterPlay = (move) => {
     }
   };
   // Pack into one moves array, then send
-  curMoves.push({
-    appear: move.appear,
-    vanish: move.vanish,
-    start: move.start,
-    end: move.end
-  });
+  curMoves.push(move);
   if (vr.turn != playerColor) {
     toggleTurnIndicator(false);
     send("newmove",
@@ -451,6 +448,7 @@ function initializeGame(obj) {
   const options = obj.options || {};
   import(`/variants/${obj.vname}/class.js`).then(module => {
     window.V = module.default;
+    for (const [k, v] of Object.entries(V.Aliases)) window[k] = v;
     // Load CSS. Avoid loading twice the same stylesheet:
     const allIds = [].slice.call($.styleSheets).map(s => s.id);
     const newId = obj.vname + "_css";