Skip to content

Commit

Permalink
Linux compilation fix
Browse files Browse the repository at this point in the history
Bench: 12012658
  • Loading branch information
Dannyj1 committed Jan 22, 2023
1 parent 75bc484 commit d48ab17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/timemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Zagreus {
}

uint64_t movesToGo = params.movestogo ? params.movestogo : 40ULL - (bitboard.getPly() / 2);
movesToGo = std::max(movesToGo, 7ULL);
movesToGo = std::max((uint64_t) movesToGo, (uint64_t) 7ULL);
uint64_t timeLeft = 0;

if (movingColor == PieceColor::WHITE) {
Expand All @@ -46,15 +46,15 @@ namespace Zagreus {
}

timeLeft -= engine.getOption("Move Overhead").getIntValue();
timeLeft = std::max(timeLeft, 1ULL);
timeLeft = std::max((uint64_t) timeLeft, (uint64_t) 1ULL);
uint64_t maxTime = timeLeft / 100 * 80;
uint64_t timePerMove = timeLeft / movesToGo;

if (timePerMove > maxTime) {
timePerMove = maxTime;
}

timePerMove = std::max(timePerMove, 1ULL);
timePerMove = std::max((uint64_t) timePerMove, (uint64_t) 1ULL);

return std::chrono::high_resolution_clock::now() + std::chrono::milliseconds(timePerMove);
}
Expand Down

0 comments on commit d48ab17

Please sign in to comment.