Skip to content

Commit

Permalink
Fix search log when using skills
Browse files Browse the repository at this point in the history
In case of we pick a sub-optimal move be
sure to print this, and not the best one
on seach log file.

Bug spotted by Guenther Demetz.

No functional change.
  • Loading branch information
mcostalba committed Jun 8, 2013
1 parent 2a98042 commit 05c6f7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/search.cpp
Expand Up @@ -416,8 +416,12 @@ namespace {

if (Options["Use Search Log"])
{
RootMove& rm = RootMoves[0];
if (skill.best != MOVE_NONE)
rm = *std::find(RootMoves.begin(), RootMoves.end(), skill.best);

Log log(Options["Search Log Filename"]);
log << pretty_pv(pos, depth, bestValue, Time::now() - SearchTime, &RootMoves[0].pv[0])
log << pretty_pv(pos, depth, rm.score, Time::now() - SearchTime, rm.pv.data())
<< std::endl;
}

Expand Down

0 comments on commit 05c6f7a

Please sign in to comment.