mirror of
https://github.com/sockspls/badfish
synced 2025-07-13 04:29:15 +00:00
Do not crash if we are asked to search mate or stalemate position.
We might be asked to ponder mate or stalemate position. This being the case, simply wait for stop or ponderhit. Currently we crash. UCI specs aren't clear on the issue, but it cost nothing to add little check. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
455993b289
commit
ae0b965711
1 changed files with 8 additions and 0 deletions
|
@ -677,6 +677,14 @@ namespace {
|
|||
// searchMoves are verified, copied, scored and sorted
|
||||
RootMoveList rml(p, searchMoves);
|
||||
|
||||
if (rml.move_count() == 0)
|
||||
{
|
||||
if (PonderSearch)
|
||||
wait_for_stop_or_ponderhit();
|
||||
|
||||
return pos.is_check()? -VALUE_MATE : VALUE_DRAW;
|
||||
}
|
||||
|
||||
// Print RootMoveList c'tor startup scoring to the standard output,
|
||||
// so that we print information also for iteration 1.
|
||||
std::cout << "info depth " << 1 << "\ninfo depth " << 1
|
||||
|
|
Loading…
Add table
Reference in a new issue