X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=37f5c7bd1b61a034e56e9471fc4cd74f074be7ce;hb=f8c7d9bb05d38e91899b0bd81282239f076fbb37;hp=4045bb54f7cdce2306d43d138f741c2cae5c71d9;hpb=23c6ef78cb21c7dac5a6a43c8f3c2875efa76891;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 4045bb5..37f5c7b 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -7,7 +7,7 @@ * @type {Number} * @const * @private */ -var SCRIPT_VERSION = 2021010201; +var SCRIPT_VERSION = 2021021300; /** * The current backend URL. @@ -664,8 +664,9 @@ var add_pv = function(start_fen, pv, move_num, toplay, scores, start_display_mov if (scores !== null && scores.length >= 1 && scores[scores.length - 1].score !== undefined && scores[scores.length - 1].score !== null && - scores[scores.length - 1].score[0] === "tb") { - splicepos = Math.abs(scores[scores.length - 1].score[1]); + (scores[scores.length - 1].score[0] === 'T' || + scores[scores.length - 1].score[0] === 't')) { + splicepos = scores[scores.length - 1].score[1]; } return print_pv(display_lines.length - 1, splicepos, opt_limit, opt_showlast); } @@ -2129,7 +2130,7 @@ var format_short_score = function(score) { if (score[0] === 'T') { return ret + Math.ceil(score[1] / 2); } else { - return ret + "-" + Math.ceil(-score[1] / 2); + return ret + "-" + Math.ceil(score[1] / 2); } } else if (score[0] === 'M' || score[0] === 'm') { var sign = (score[0] === 'm') ? '-' : ''; @@ -2158,7 +2159,7 @@ var format_long_score = function(score) { if (score[1] == 0) { return "Won for white (tablebase)"; } else { - return "White wins in " + Math.ceil(score[1]); + return "White wins in " + Math.ceil(score[1] / 2); } } else if (score[0] === 't') { if (score[1] == -1) {