Skip to content

Commit

Permalink
only use bound check for time != 0 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
QueensGambit committed Jun 16, 2021
1 parent a40920c commit 1565438
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions engine/src/manager/timemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1565438

Please # to comment.