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

Always print a best move when requested

Little fix merged from iPhone Glaurung.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-03-22 14:49:18 +01:00
parent 66d165921d
commit 0ff3bf34cd

View file

@ -748,6 +748,11 @@ namespace {
<< " hashfull " << TT.full() << std::endl; << " hashfull " << TT.full() << std::endl;
// Print the best move and the ponder move to the standard output // 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]; std::cout << "bestmove " << ss[0].pv[0];
if (ss[0].pv[1] != MOVE_NONE) if (ss[0].pv[1] != MOVE_NONE)
std::cout << " ponder " << ss[0].pv[1]; 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); TT.store(pos, value_to_tt(bestValue, ply), depth, m, VALUE_TYPE_LOWER);
} }
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
return bestValue; return bestValue;
} }