X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=c15cd7537e6a8589160842f596a735b1f377317a;hb=61381372ec896ae6b0f139555e6e3f816d8aa570;hp=c676bd6d62ca05d46f5851ca5211f661f6a50f7b;hpb=a0afe32d16554ff3b5c74f34ae56400f35759edf;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index c676bd6d..c15cd753 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1861,12 +1861,15 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) { { bool updated = rootMoves[i].score != -VALUE_INFINITE; - if (depth == 1 && !updated) + if (depth == 1 && !updated && i > 0) continue; - Depth d = updated ? depth : depth - 1; + Depth d = updated ? depth : std::max(1, depth - 1); Value v = updated ? rootMoves[i].score : rootMoves[i].previousScore; + if (v == -VALUE_INFINITE) + v = VALUE_ZERO; + bool tb = TB::RootInTB && abs(v) < VALUE_MATE_IN_MAX_PLY; v = tb ? rootMoves[i].tbScore : v;