On the way to simplify : gameState + gameInfo everywhere = game
[vchess.git] / client / src / components / ComputerGame.vue
index 238f109..5196e54 100644 (file)
@@ -10,6 +10,10 @@ import BaseGame from "@/components/BaseGame.vue";
 import { store } from "@/store";
 import Worker from 'worker-loader!@/playCompMove';
 
+
+// TODO: simplify, just "game" and "gameInfo" prop (fen+mode+vname may change at the same time)
+
+
 export default {
   name: 'my-computer-game',
   components: {
@@ -100,7 +104,7 @@ export default {
       this.compWorker.postMessage(["newmove",move]);
       // subTurn condition for Marseille (and Avalanche) rules
       if ((!this.vr.subTurn || this.vr.subTurn <= 1)
-        && (this.mode == "auto" || this.vr.turn != this.mycolor))
+        && (this.mode == "auto" || this.vr.turn != this.gameInfo.mycolor))
       {
         this.playComputerMove();
       }