X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=bba9ad5735bc1cf0249c63e70700fa13ac54e334;hb=95264bb7edad2a22c3a4db6a91082389732a26c8;hp=5f3223dc5b8db45357e6c61f80fb4c75ee9d35bb;hpb=dd773b98b2dbe86e1b6dda36b58cedd46148eb26;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 5f3223d..bba9ad5 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1793,9 +1793,10 @@ var get_best_move = function(game, source, target) { } 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_score = line['score_sort_key']; + best_move_score = score; } } }