aboutsummaryrefslogtreecommitdiff
path: root/src/bot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bot.cpp')
-rw-r--r--src/bot.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bot.cpp b/src/bot.cpp
index ef6f647..13e3c57 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -208,9 +208,14 @@ static int search(int depth, Game *b, int alpha, int beta, int ply) {
}
}
if (!searchStopped) {
- const Flag flag = bestScore <= alphaOrig ? UPPERBOUND
- : bestScore >= beta ? LOWERBOUND
- : EXACT;
+
+ Flag flag = EXACT;
+ if (bestScore > beta) {
+ flag = UPPERBOUND;
+ }
+ if (bestScore < alphaOrig) {
+ flag = LOWERBOUND;
+ }
(*b->Transpositions)[gameHash] = {
.depth = depth, .Eval = bestScore, .flag = flag, .bestMove = bestMove};
@@ -299,7 +304,7 @@ Move GetBestMove(Game *b, int maxDepth, move_options options) {
int increment = b->turn ? options.wncr : options.bncr;
double time_remaning = b->turn ? options.wtime : options.btime;
- timeToThingMS = (time_remaning / 20 + increment * 0.8);
+ timeToThingMS = ((time_remaning / 20) + (increment * 0.8));
}
bool continueSearching = true;