1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 17:19:36 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-03-19 16:00:09 +01:00
parent 5ea08e79c4
commit 920b1abede

View file

@ -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;
}