X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=remoteglot.pl;h=675ef5011ec20788b08a343b0596083b5c853366;hb=be27a8c1495840effbd3c0044e205bfa5ca06808;hp=f383bb6e41088c38c4ba767d47cbb924eacab23c;hpb=8a95f87af48bd7388bf23115537f7e2381a2e17d;p=remoteglot-book 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(); }