From: Benjamin Auder Date: Thu, 14 Jan 2021 21:06:18 +0000 (+0100) Subject: Better fix to remove corrupted games vs computer X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/images/pieces/scripts/css/index.css?a=commitdiff_plain;h=996bdaa457f04f8b65b4018193ace54ccec953c1;p=vchess.git Better fix to remove corrupted games vs computer --- diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index 72e4f5e3..9cd5f9b1 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -61,7 +61,7 @@ export default { methods: { launchGame: function(game) { this.compWorker.postMessage(["scripts", this.gameInfo.vname]); - if (!game || !V.IsGoodFen(game.fen)) { + if (!game) { game = { vname: this.gameInfo.vname, fenStart: V.GenRandInitFen(this.st.settings.randomness), diff --git a/client/src/views/Rules.vue b/client/src/views/Rules.vue index dc96ffb4..c069eb29 100644 --- a/client/src/views/Rules.vue +++ b/client/src/views/Rules.vue @@ -120,7 +120,12 @@ export default { this.gameInfo.mode = mode; if (this.gameInfo.mode == "versus") { CompgameStorage.get(this.gameInfo.vname, (game) => { - // NOTE: game might be null + // NOTE: game might be null (if none stored yet) + if (!!game && !V.IsGoodFen(game.fen)) { + // Some issues with stored game: delete + CompgameStorage.remove(game.vname); + game = null; + } this.$refs["compgame"].launchGame(game); }); }