From: Joona Kiiski Date: Sat, 6 Feb 2010 13:55:44 +0000 (+0200) Subject: Use opening book when pondering X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d44fa4608282b1742176929b65967e37572190ae;p=fairystockfish.git 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 --- diff --git a/src/search.cpp b/src/search.cpp index 6982082..d3b229e 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; }