From: Benjamin Auder Date: Tue, 21 May 2019 21:49:53 +0000 (+0200) Subject: Fix gameInfo.mycolor in BaseGame X-Git-Url: https://git.auder.net/images/pieces/img/current/gitweb.css?a=commitdiff_plain;h=3d52a549d2be1d9644ad7b43a4a2b4aa988b6bdb;p=vchess.git Fix gameInfo.mycolor in BaseGame --- 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(); }