Fix
[vchess.git] / client / src / components / BaseGame.vue
index 5fbc257..2a54cbb 100644 (file)
@@ -359,6 +359,11 @@ export default {
           new Audio("/sounds/move.mp3").play().catch(() => {});
         if (this.vr.turn != initurn) {
           // Turn has changed: move is complete
+          if (!smove.fen) {
+            // NOTE: only FEN of last sub-move is required (thus setting it here)
+            smove.fen = this.vr.getFen();
+            this.emitFenIfAnalyze();
+          }
           this.inMultimove = false;
           const score = this.vr.getCurrentScore();
           if (score != "*") {
@@ -405,11 +410,8 @@ export default {
       if (received && this.cursor < this.moves.length - 1)
         this.gotoEnd();
       playMove();
-      this.lastMove.fen = this.vr.getFen();
-      this.emitFenIfAnalyze();
     },
     cancelCurrentMultimove: function() {
-      // Cancel current multi-move
       const L = this.moves.length;
       let move = this.moves[L-1];
       if (!Array.isArray(move)) move = [move];