]> git.sesse.net Git - remoteglot/commitdiff
Fix 7-man tablebase mate length.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 16 Nov 2014 18:33:28 +0000 (19:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 16 Nov 2014 18:33:28 +0000 (19:33 +0100)
remoteglot.pl

index f383bb6e41088c38c4ba767d47cbb924eacab23c..675ef5011ec20788b08a343b0596083b5c853366 100755 (executable)
@@ -511,7 +511,7 @@ sub output {
 
                my $t = $tb_cache{$fen};
                my $pv = $t->{'pv'};
 
                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') {
                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,
                                }
                                $tb_cache{$fen} = {
                                        result => $pgn->result,
-                                       pv => \@uci_moves
+                                       pv => \@uci_moves,
+                                       score => $response->{'Response'}{'Score'},
                                };
                                output();
                        }
                                };
                                output();
                        }