From d34683e228fef0efe646611ae42032bea22c583a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 22 Mar 2016 18:20:32 +0100 Subject: [PATCH] Prioritize the current display line in move selection. --- www/js/remoteglot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index e478fb8..b6076f4 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1806,6 +1806,15 @@ var get_best_move = function(game, source, target, invert) { move_hash[moves[i].san] = moves[i]; } + // See if we're already exploring some line. + if (current_display_line && + current_display_move < current_display_line.pretty_pv.length - 1) { + var first_move = current_display_line.pretty_pv[current_display_move + 1]; + if (move_hash[first_move]) { + return move_hash[first_move]; + } + } + // History and PV take priority over the display lines. for (var i = 0; i < 2; ++i) { var line = display_lines[i]; -- 2.39.2