]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Fix a typo in mate sorting.
[remoteglot] / remoteglot.pl
index 76163703bcf033921780c2496c550169511ef863..4ccdac7e4b873d69143194795f2e6f71e0715806 100755 (executable)
@@ -694,10 +694,10 @@ sub score_sort_key {
                my $score;
                if ($mate > 0) {
                        # Side to move mates
-                       $mate = 99999 - $mate;
+                       $score = 99999 - $mate;
                } else {
                        # Side to move is getting mated (note the double negative for $mate)
-                       $mate = -99999 - $mate;
+                       $score = -99999 - $mate;
                }
                if ($invert) {
                        $score = -$score;
@@ -861,7 +861,7 @@ sub handle_tb_lookup_return {
                        # position in the meantime, we might query a completely
                        # different position! But that's fine.
                } else {
-                       die "Unknown response state state " . $response->{'Response'}{'StateString'};
+                       die "Unknown response state " . $state;
                }
 
                # Wait a second before we schedule another one.