From 3d52a549d2be1d9644ad7b43a4a2b4aa988b6bdb Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 21 May 2019 23:49:53 +0200
Subject: [PATCH] Fix gameInfo.mycolor in BaseGame

---
 client/src/components/BaseGame.vue     | 7 ++++---
 client/src/components/ComputerGame.vue | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue
index 1e7a83bb..c980400d 100644
--- a/client/src/components/BaseGame.vue
+++ b/client/src/components/BaseGame.vue
@@ -6,8 +6,9 @@
       .card.smallpad.small-modal.text-center
         label.modal-close(for="modalEog")
         h3#eogMessage.section {{ endgameMessage }}
-    Board(:vr="vr" :last-move="lastMove" :analyze="analyze" :user-color="mycolor"
-      :orientation="orientation" :vname="vname" @play-move="play")
+    Board(:vr="vr" :last-move="lastMove" :analyze="analyze"
+      :user-color="gameInfo.mycolor" :orientation="orientation"
+      :vname="vname" @play-move="play")
     .button-group
       button(@click="() => play()") Play
       button(@click="() => undo()") Undo
@@ -55,7 +56,7 @@ export default {
   },
   watch: {
     // fenStart changes when a new game starts
-    fenStart: function() {
+    "gameInfo.fenStart": function() {
       // Reset all variables
       this.endgameMessage = "";
       this.orientation = this.gameInfo.mycolor || "w";
diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue
index 238f1092..5ecc1a65 100644
--- a/client/src/components/ComputerGame.vue
+++ b/client/src/components/ComputerGame.vue
@@ -100,7 +100,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();
       }
-- 
2.44.0