X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=9f4b6df803db3d687ddea57f826de7d50c3b923f;hp=254741d53964848b10bbf12e265a872984ee6d2a;hb=27d18a24ff2f3b04a7bf26b9b95c7214f8e5076a;hpb=809ba2aa7682693e33f7b92c1fdfbb3b004befb4 diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 254741d5..9f4b6df8 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -85,13 +85,14 @@ export default { this.moves = JSON.parse(JSON.stringify(this.game.moves || [])); // Post-processing: decorate each move with color + current FEN: // (to be able to jump to any position quickly) + let vr_tmp = new V(this.game.fenStart); //vr is already at end of game this.moves.forEach(move => { // NOTE: this is doing manually what play() function below achieve, // but in a lighter "fast-forward" way - move.color = this.vr.turn; - move.notation = this.vr.getNotation(move); - this.vr.play(move); - move.fen = this.vr.getFen(); + move.color = vr_tmp.turn; + move.notation = vr_tmp.getNotation(move); + vr_tmp.play(move); + move.fen = vr_tmp.getFen(); }); const L = this.moves.length; this.cursor = L-1;