X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=785cf0efb8ec7ec055f369ec3566c88f9dd87ccf;hp=b43ebd02ab848ae4f2675bd0eaba637b8f9532b8;hb=5436d98fc54600ead011304274250e8b5de35c6a;hpb=22715259a04497743afe7e33f5cf1e3b13bb097e diff --git a/src/search.cpp b/src/search.cpp index b43ebd02..785cf0ef 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -524,7 +524,7 @@ namespace { if (!RootNode) { // Step 2. Check for aborted search and immediate draw - if (Signals.stop || pos.is_draw() || ss->ply > MAX_PLY) + if (Signals.stop || (PvNode?pos.is_draw():pos.is_draw()) || ss->ply > MAX_PLY) return DrawValue[pos.side_to_move()]; // Step 3. Mate distance pruning. Even if we mate at the next move our score @@ -958,7 +958,7 @@ split_point_start: // At split points actual search starts from here // ran out of time. In this case, the return value of the search cannot // be trusted, and we don't update the best move and/or PV. if (Signals.stop || thisThread->cutoff_occurred()) - return bestValue; + return value; // To avoid returning VALUE_INFINITE if (RootNode) { @@ -1103,7 +1103,7 @@ split_point_start: // At split points actual search starts from here ss->ply = (ss-1)->ply + 1; // Check for an instant draw or maximum ply reached - if (pos.is_draw() || ss->ply > MAX_PLY) + if (pos.is_draw() || ss->ply > MAX_PLY) return DrawValue[pos.side_to_move()]; // Transposition table lookup. At PV nodes, we don't use the TT for @@ -1552,7 +1552,7 @@ void RootMove::extract_pv_from_tt(Position& pos) { && pos.is_pseudo_legal(m) && pos.pl_move_is_legal(m, pos.pinned_pieces()) && ply < MAX_PLY - && (!pos.is_draw() || ply < 2)) + && (!pos.is_draw() || ply < 2)) { pv.push_back(m); pos.do_move(m, *st++);