From 15654389da6afca9f47157e1a6c4dd27fad594aa Mon Sep 17 00:00:00 2001 From: QueensGambit Date: Wed, 16 Jun 2021 14:55:23 +0200 Subject: [PATCH] only use bound check for time != 0 (#136) --- engine/src/manager/timemanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/src/manager/timemanager.cpp b/engine/src/manager/timemanager.cpp index 71dcff19..91596135 100644 --- a/engine/src/manager/timemanager.cpp +++ b/engine/src/manager/timemanager.cpp @@ -89,8 +89,11 @@ int TimeManager::get_time_for_move(const SearchLimits* searchLimits, SideToMove curMovetime = apply_random_factor(curMovetime); - // make sure the returned movetime is within bounds - return min(searchLimits->get_safe_remaining_time(me), curMovetime); + if (searchLimits->time[me] != 0) { + // make sure the returned movetime is within bounds + return min(searchLimits->get_safe_remaining_time(me), curMovetime); + } + return curMovetime; } int TimeManager::get_thresh_move() const