]> git.sesse.net Git - stockfish/blobdiff - src/timeman.cpp
Fix +M0 score when low on time
[stockfish] / src / timeman.cpp
index 9f131d46d512d0ba6e4494ec81db724bd7698524..702f0f31eafb8f7d751552078bf12b18a889e6f9 100644 (file)
@@ -92,7 +92,7 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u
 
   // Initialize all to maximum values but unstablePVExtraTime that is reset
   unstablePVExtraTime = 0;
-  optimumSearchTime = maximumSearchTime = limits.time[us];
+  optimumSearchTime = maximumSearchTime = std::max(limits.time[us], minThinkingTime);
 
   // We calculate optimum time usage for different hypothetical "moves to go"-values and choose the
   // minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.