diff --git a/AUTHORS b/AUTHORS index 23d15fe3b..0d157b655 100644 --- a/AUTHORS +++ b/AUTHORS @@ -266,6 +266,7 @@ Uri Blass (uriblass) Vince Negri (cuddlestmonkey) Viren Wencey Wang +Will Miles (willm) windfishballad xefoci7612 Xiang Wang (KatyushaScarlet) diff --git a/src/timeman.cpp b/src/timeman.cpp index 4e98081bc..ba84ed875 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -129,9 +129,10 @@ void TimeManagement::init(Search::LimitsType& limits, } // Limit the maximum possible time for this move - optimumTime = TimePoint(optScale * timeLeft); + optimumTime = TimePoint(std::max(1.0, optScale * timeLeft)); maximumTime = - TimePoint(std::min(0.825179 * limits.time[us] - moveOverhead, maxScale * optimumTime)) - 10; + TimePoint(std::max(double(optimumTime), std::min(0.825179 * limits.time[us] - moveOverhead, + maxScale * optimumTime))); if (options["Ponder"]) optimumTime += optimumTime / 4;