X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=4dc7d9e9b02aa565a56dd626155c706baf5893ad;hp=dc4ec05e2f586607453270181e6cd9e7bbe841d6;hb=20023ac9b8c28d8b15308d7bf5be4fad8501535d;hpb=7eaea3848c9e8a388c0b79cee6fba6bf3cd32108 diff --git a/src/thread.cpp b/src/thread.cpp index dc4ec05e..4dc7d9e9 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -190,6 +190,8 @@ void ThreadPool::start_thinking(const Position& pos, StateListPtr& states, if (states.get()) setupStates = std::move(states); // Ownership transfer, states is now empty + StateInfo tmp = setupStates->back(); + for (Thread* th : Threads) { th->maxPly = 0; @@ -198,5 +200,7 @@ void ThreadPool::start_thinking(const Position& pos, StateListPtr& states, th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th); } + setupStates->back() = tmp; // Restore st->previous, cleared by Position::set() + main()->start_searching(); }