From d44fa4608282b1742176929b65967e37572190ae Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Sat, 6 Feb 2010 15:55:44 +0200 Subject: [PATCH] Use opening book when pondering Otherwise we will not use move given by opening book when we receive 'ponderhit'-command. Signed-off-by: Marco Costalba --- src/search.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 69820822..d3b229e6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -351,7 +351,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, UseTimeManagement = !ExactMaxTime && !MaxDepth && !MaxNodes && !InfiniteSearch; // Look for a book move, only during games, not tests - if (UseTimeManagement && !ponder && get_option_value_bool("OwnBook")) + if (UseTimeManagement && get_option_value_bool("OwnBook")) { Move bookMove; if (get_option_value_string("Book File") != OpeningBook.file_name()) @@ -360,6 +360,9 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, bookMove = OpeningBook.get_move(pos); if (bookMove != MOVE_NONE) { + if (PonderSearch) + wait_for_stop_or_ponderhit(); + cout << "bestmove " << bookMove << endl; return true; } -- 2.39.2