From 920b1abede63303a991a014d8de069856e81f046 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 19 Mar 2011 16:00:09 +0100 Subject: [PATCH] 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 --- src/search.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; } -- 2.39.2