From 05c6f7a40b62f286873945f937c2ef3cae183e41 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 8 Jun 2013 10:35:35 +0200 Subject: [PATCH] Fix search log when using skills 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index c6ee8c86..7ff9aaa4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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; } -- 2.39.2