my $key = join('', @pv);
my @moves = ();
if (exists($pos->{'tbprobe_cache'}{$key})) {
- @moves = $pos->{'tbprobe_cache'}{$key};
+ @moves = @{$pos->{'tbprobe_cache'}{$key}};
} else {
+ if ($mpv ne '') {
+ # Force doing at least one move of the PV.
+ my $move = shift @pv;
+ push @moves, $move;
+ $pos = $pos->make_move(parse_uci_move($move));
+ }
+
while ($pos->num_pieces() > 6 && $#pv > -1) {
my $move = shift @pv;
push @moves, $move;
($pos, $uci_move) = $pos->make_pretty_move($move);
push @moves, $uci_move;
}
+
+ $pos->{'tbprobe_cache'}{$key} = \@moves;
}
$info->{'pv' . $mpv} = \@moves;