From 8b67b7ecd8b0d4d4ddf8c15c44806f8a6ab441d7 Mon Sep 17 00:00:00 2001 From: Tierynn Byrnes Date: Mon, 19 Feb 2024 07:13:26 +1000 Subject: [PATCH] use current time instead of '1' for timeLeft formula. --- src/timeman.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/timeman.cpp b/src/timeman.cpp index 72a447af5b8..286072848b3 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -85,11 +85,11 @@ void TimeManagement::init(Search::LimitsType& limits, int mtg = limits.movestogo ? std::min(limits.movestogo, 50) : 50; // Make sure timeLeft is > 0 since we may use it as a divisor - TimePoint timeLeft = std::max(TimePoint(1), limits.time[us] + limits.inc[us] * (mtg - 1) - - moveOverhead * (2 + mtg)); + // If there is a healthy increment and low mtg, timeLeft can exceed actual available + TimePoint timeLeft = std::max(limits.time[us], limits.time[us] + limits.inc[us] * (mtg - 1) + - moveOverhead * (2 + mtg)); // x basetime (+ z increment) - // If there is a healthy increment, timeLeft can exceed actual available // game time for the current move, so also cap to 20% of available game time. if (limits.movestogo == 0) {