Fix a bug where an invisible PV could be selected when making a move on the board.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 23 Mar 2016 19:25:26 +0000 (20:25 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 23 Mar 2016 19:25:26 +0000 (20:25 +0100)
www/js/remoteglot.js

index 26abd4a..44f6c79 100644 (file)
@@ -1973,6 +1973,10 @@ var onSnapEnd = function(source, target) {
        // this move, then select that. Note that this gives us a good priority
        // order (history first, then PV, then multi-PV lines).
        for (var i = 0; i < display_lines.length; ++i) {
+               if (i == 1 && current_display_line) {
+                       // Do not choose PV if not on it.
+                       continue;
+               }
                var line = display_lines[i];
                if (line.pv[line.start_display_move_num] === move.san) {
                        show_line(i, 0);