]> git.sesse.net Git - remoteglot/commitdiff
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 26abd4ae14a382fe293975cdf3a757b087b2b793..44f6c79a9d26cc96b3964fb731878c889eb820e9 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) {
        // 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);
                var line = display_lines[i];
                if (line.pv[line.start_display_move_num] === move.san) {
                        show_line(i, 0);