]> git.sesse.net Git - remoteglot/commitdiff
Fix score sorting (sigh).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Mar 2016 22:09:14 +0000 (23:09 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Mar 2016 22:09:14 +0000 (23:09 +0100)
www/js/remoteglot.js

index 5f3223dc5b8db45357e6c61f80fb4c75ee9d35bb..bba9ad5735bc1cf0249c63e70700fa13ac54e334 100644 (file)
@@ -1793,9 +1793,10 @@ var get_best_move = function(game, source, target) {
                }
                var first_move = line['pv_pretty'][0];
                if (move_hash[first_move]) {
                }
                var first_move = line['pv_pretty'][0];
                if (move_hash[first_move]) {
-                       if (best_move_score === null || line['score_sort_key'] > best_move_score) {
+                       var score = parseInt(line['score_sort_key'], 10);
+                       if (best_move_score === null || score > best_move_score) {
                                best_move = move_hash[first_move];
                                best_move = move_hash[first_move];
-                               best_move_score = line['score_sort_key'];
+                               best_move_score = score;
                        }
                }
        }
                        }
                }
        }