Fix enter/exit analyze mode in the middle of a multi-move
[vchess.git] / client / src / components / BaseGame.vue
index 5e363b1..7424aa4 100644 (file)
@@ -61,12 +61,6 @@ div#baseGame
 </template>
 
 <script>
-
-// https://vchess.club/#/game/46
-// Bug 35eme coup blanc Rx(P)e2, d2 et aussi 18eme coup blanc Rd7, Pxe6
-// --> peut-être lié à prise, ou lié à getFen(), ou inMultimove pas changé car concatène à coup précédent...
-// TODO: also fix moves played on smartphone, annoying shift...
-
 import Board from "@/components/Board.vue";
 import MoveList from "@/components/MoveList.vue";
 import params from "@/parameters";
@@ -264,8 +258,11 @@ export default {
       else this.lastMove = null;
     },
     toggleAnalyze: function() {
+      // Autoplay has priority:
+      if (this.autoplay) return;
       if (this.mode != "analyze") {
         // Enter analyze mode:
+        if (this.inMultimove) this.cancelCurrentMultimove();
         this.gameMode = this.mode; //was not 'analyze'
         this.mode = "analyze";
         this.gameCursor = this.cursor;