From: Marco Costalba Date: Sat, 19 Mar 2011 15:00:09 +0000 (+0100) Subject: Do not send ponder move if we don't have it X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=920b1abede63303a991a014d8de069856e81f046 Do not send ponder move if we don't have it Has been reported by Justin Blanchard that this creates problems on some buggy GUI. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index d94128eb..9a3ecbbe 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -578,8 +578,15 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[ if (!StopRequest && (Pondering || InfiniteSearch)) wait_for_stop_or_ponderhit(); - // Could be both MOVE_NONE when searching on a stalemate position - cout << "bestmove " << bestMove << " ponder " << ponderMove << endl; + // Could be MOVE_NONE when searching on a stalemate position + cout << "bestmove " << bestMove; + + // UCI protol is not clear on allowing sending an empty ponder move, instead + // it is clear that ponder move is optional. So skip it if empty. + if (ponderMove != MOVE_NONE) + cout << " ponder " << ponderMove; + + cout << endl; return !QuitRequest; }