From: Steinar H. Gunderson Date: Wed, 23 Mar 2016 11:11:04 +0000 (+0100) Subject: Turn off the depth secondary key sorting for the purpose of arrows. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=7917c883f010cb21de584cc7d69acb7489523b4c Turn off the depth secondary key sorting for the purpose of arrows. --- diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 5cd1a97..26abd4a 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -584,7 +584,7 @@ var find_nonstupid_moves = function(data, margin, invert) { var pv_score = undefined; for (var move in data['refutation_lines']) { var line = data['refutation_lines'][move]; - var score = compute_score_sort_key(line['score'], line['depth'], invert); + var score = compute_score_sort_key(line['score'], line['depth'], invert, false); if (move == data['pv'][0]) { pv_score = score; } @@ -2061,9 +2061,10 @@ var compute_plot_score = function(score) { * @param score The score digest tuple. * @param {?number} depth Depth the move has been computed to, or null. * @param {boolean} invert Whether black is to play. + * @param {boolean=} depth_secondary_key * @return {number} */ -var compute_score_sort_key = function(score, depth, invert) { +var compute_score_sort_key = function(score, depth, invert, depth_secondary_key) { var s; if (!score) { return -10000000; @@ -2083,7 +2084,11 @@ var compute_score_sort_key = function(score, depth, invert) { } if (s) { if (invert) s = -s; - return s * 200 + (depth || 0); + if (depth_secondary_key) { + return s * 200 + (depth || 0); + } else { + return s; + } } else { return null; }