X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fhash-lookup.js;h=654a3f9b9202ea9a1e16b2c324a77fc7a72f68d4;hb=fa63488e30a81f4370aa1e9a565b3d2331f553a6;hp=274490f101327ca75f2fadd491517f6c4a68438d;hpb=311ed98a1cf3eefa25779aa8a67b8532cb619793;p=remoteglot diff --git a/www/js/hash-lookup.js b/www/js/hash-lookup.js index 274490f..654a3f9 100644 --- a/www/js/hash-lookup.js +++ b/www/js/hash-lookup.js @@ -86,12 +86,13 @@ var translate_line = function(board, fen, line) { } r['pv_pretty'] = pv; - // Convert the score. + // Convert the score. Use the static eval if no search. + var value = line['value'] || line['eval']; var score = null; - if (line['value']['score_type'] === 'SCORE_CP') { - score = ['cp', line['value']['score_cp']]; - } else if (line['value']['score_mate'] === 'SCORE_MATE') { - score = ['m', line['value']['score_mate']]; + if (value['score_type'] === 'SCORE_CP') { + score = ['cp', value['score_cp']]; + } else if (value['score_type'] === 'SCORE_MATE') { + score = ['m', value['score_mate']]; } if (score) { if (line['bound'] === 'BOUND_UPPER') {