From 0ff3bf34cda9479d6c0d40d11ed0496329462edf Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 22 Mar 2009 14:49:18 +0100 Subject: [PATCH] Always print a best move when requested Little fix merged from iPhone Glaurung. Signed-off-by: Marco Costalba --- src/search.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index 64acc3a8..8d6ddb8d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -748,6 +748,11 @@ namespace { << " hashfull " << TT.full() << std::endl; // Print the best move and the ponder move to the standard output + if (ss[0].pv[0] == MOVE_NONE) + { + ss[0].pv[0] = rml.get_move(0); + ss[0].pv[1] = MOVE_NONE; + } std::cout << "bestmove " << ss[0].pv[0]; if (ss[0].pv[1] != MOVE_NONE) std::cout << " ponder " << ss[0].pv[1]; @@ -1389,6 +1394,9 @@ namespace { } TT.store(pos, value_to_tt(bestValue, ply), depth, m, VALUE_TYPE_LOWER); } + + assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); + return bestValue; } -- 2.39.2