]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Fix 0.00 showing for long_score, too.
[remoteglot] / remoteglot.pl
index b480b80f8da1b9aa443c4bf54785a4f58e90a76a..c65c7e8a29fdafa8106a6e8610a3126be39c34f2 100755 (executable)
@@ -684,7 +684,7 @@ sub output_screen {
        #
        if (exists($info->{'pv1'}) && !exists($info->{'pv2'})) {
                for my $key (qw(pv score_cp score_mate nodes nps depth seldepth tbhits)) {
-                       if (exists($info->{$key . '1'}) && !exists($info->{$key})) {
+                       if (exists($info->{$key . '1'})) {
                                $info->{$key} = $info->{$key . '1'};
                        }
                }
@@ -1058,6 +1058,9 @@ sub short_score {
        } else {
                if (exists($info->{'score_cp' . $mpv})) {
                        my $score = $info->{'score_cp' . $mpv} * 0.01;
+                       if ($score == 0) {
+                               return " 0.00";
+                       }
                        if ($invert) {
                                $score = -$score;
                        }
@@ -1085,6 +1088,9 @@ sub score_sort_key {
        } else {
                if (exists($info->{'score_cp' . $mpv})) {
                        my $score = $info->{'score_cp' . $mpv};
+                       if ($score == 0) {
+                               return " 0.00";
+                       }
                        if ($invert) {
                                $score = -$score;
                        }