]> git.sesse.net Git - stockfish/commitdiff
Fix search log when using skills
authorMarco Costalba <mcostalba@gmail.com>
Sat, 8 Jun 2013 08:35:35 +0000 (10:35 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 8 Jun 2013 08:56:20 +0000 (10:56 +0200)
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.

src/search.cpp

index c6ee8c86b9c425ff7e55b618ce77070f9b618914..7ff9aaa466902ae5b851ea2c225a853d8416c576 100644 (file)
@@ -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;
         }