]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Fix some move number display issues. Argh.
[remoteglot] / remoteglot.pl
index 313ccbe9026c1d807b641d39473de330132ac866..675573def081eabb2c1c6ee204456abfaf067d42 100755 (executable)
@@ -1144,9 +1144,9 @@ sub score_sort_key {
 
        if (defined($info->{'score_mate' . $mpv})) {
                if ($invert) {
-                       return -(99999 - $info->{'score_mate' . $mpv});
-               } else {
                        return 99999 - $info->{'score_mate' . $mpv};
+               } else {
+                       return -(99999 - $info->{'score_mate' . $mpv});
                }
        } else {
                if (exists($info->{'score_cp' . $mpv})) {
@@ -1177,6 +1177,9 @@ sub long_score {
        } else {
                if (exists($info->{'score_cp' . $mpv})) {
                        my $score = $info->{'score_cp' . $mpv} * 0.01;
+                       if ($score == 0) {
+                               return " 0.00";
+                       }
                        if ($pos->{'toplay'} eq 'B') {
                                $score = -$score;
                        }