diff --git a/src/search.cpp b/src/search.cpp index 466c9ec10eb..dd8a70baa63 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -314,6 +314,7 @@ void Thread::search() { optimism[~us] = -optimism[us]; int searchAgainCounter = 0; + bool increaseThreadDepth = true; // Iterative deepening loop until requested to stop or the target depth is reached while ( ++rootDepth < MAX_PLY @@ -333,7 +334,13 @@ void Thread::search() { pvLast = 0; if (!Threads.increaseDepth) - searchAgainCounter++; + increaseThreadDepth = false; + + if (!increaseThreadDepth) + { + searchAgainCounter++; + increaseThreadDepth = true; + } // MultiPV loop. We perform a full root search for each PV line for (pvIdx = 0; pvIdx < multiPV && !Threads.stop; ++pvIdx)