From: Steinar H. Gunderson Date: Sun, 16 Nov 2014 18:33:28 +0000 (+0100) Subject: Fix 7-man tablebase mate length. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=be27a8c1495840effbd3c0044e205bfa5ca06808 Fix 7-man tablebase mate length. --- diff --git a/remoteglot.pl b/remoteglot.pl index f383bb6..675ef50 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -511,7 +511,7 @@ sub output { my $t = $tb_cache{$fen}; my $pv = $t->{'pv'}; - my $matelen = int((1 + scalar @$pv) / 2); + my $matelen = int((1 + $t->{'score'}) / 2); if ($t->{'result'} eq '1/2-1/2') { $info->{'score_cp'} = 0; } elsif ($t->{'result'} eq '1-0') { @@ -946,7 +946,8 @@ sub handle_tb_lookup_return { } $tb_cache{$fen} = { result => $pgn->result, - pv => \@uci_moves + pv => \@uci_moves, + score => $response->{'Response'}{'Score'}, }; output(); }