From 3db9b1ff9ef62d40e50b4e3bd7747b74a1a5ed7f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 17 Nov 2013 02:42:38 +0100 Subject: [PATCH] Fix some score sign issues. (These things are so easy to mess up.) --- remoteglot.pl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/remoteglot.pl b/remoteglot.pl index f42b724..fc81297 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -1130,11 +1130,6 @@ sub short_score { sub score_sort_key { my ($info, $pos, $mpv, $invert) = @_; - $invert //= 0; - if ($pos->{'toplay'} eq 'B') { - $invert = !$invert; - } - if (defined($info->{'score_mate' . $mpv})) { if ($invert) { return -(99999 - $info->{'score_mate' . $mpv}); @@ -1144,9 +1139,6 @@ 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; } @@ -1348,7 +1340,7 @@ sub give_new_move_to_second_engine { my $this = $refutation_moves{$move}; if ($this->{'depth'} < $best->{'depth'} || - ($this->{'depth'} == $best->{'depth'} && $this->{'score_cp'} < $best->{'score_cp'})) { + ($this->{'depth'} == $best->{'depth'} && score_sort_key($this, $pos, '', 1) > score_sort_key($best, $pos, '', 1))) { $best_move = $move; next; } -- 2.39.2