X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=2070cd09e076722917776200046e66ea1d13b851;hp=b3db07f902d73836d75d34654fdad8a5319224ca;hb=1c9f093dad69e4c7b6d2b42cb5e0bd3bc7224ec9;hpb=1acda11cd124a446c8bb451feae380efcc8a1cbc diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index b3db07f9..2070cd09 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -75,6 +75,7 @@ export default { const vModule = await import("@/variants/" + this.vname + ".js"); window.V = vModule.VariantRules; this.compWorker.postMessage(["scripts",this.vname]); + this.compWorker.postMessage(["init",this.fen]); this.newGameFromFen(this.fen); }, newGameFromFen: function(fen) { @@ -93,7 +94,7 @@ export default { this.mycolor = (Math.random() < 0.5 ? "w" : "b"); this.orientation = this.mycolor; this.compWorker.postMessage(["init",fen]); - if (this.mycolor != "w" || this.subMode == "auto") + if (this.mycolor != "w" || this.mode == "auto") this.playComputerMove(); } },