X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=ac03c8fc327ae78e5a028ffc732b801de273f8c1;hp=6627252fd6d3c8e54fd068b879c92a0aef403a2d;hb=69f3d8014e594ef949792d04d97b8286e9c2c268;hpb=1b61a94dbd13f6a37a89e62216615d2496c760a2 diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 6627252f..ac03c8fc 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -1287,6 +1287,12 @@ Vue.component('my-game', { }, clickComputerGame: function(e) { this.getRidOfTooltip(e.currentTarget); + if (this.mode == "computer" && this.score == "*" + && this.vr.turn != this.mycolor) + { + // Wait for computer reply first (avoid potential "ghost move" bug) + return; + } this.newGame("computer"); }, clickFriendGame: function(e) { @@ -1344,8 +1350,6 @@ Vue.component('my-game', { return; } } - else if (score == "*") - return this.continueGame("computer"); } } else if (mode == "friend") @@ -1416,7 +1420,7 @@ Vue.component('my-game', { else if (mode == "computer") { this.compWorker.postMessage(["init",fen]); - if (this.mycolor != this.vr.turn) + if (score == "*" && this.mycolor != this.vr.turn) this.playComputerMove(); } //else: nothing special to do in friend mode