diff options
Diffstat (limited to 'src/bot.cpp')
| -rw-r--r-- | src/bot.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bot.cpp b/src/bot.cpp index 61c38fa..982a4a4 100644 --- a/src/bot.cpp +++ b/src/bot.cpp @@ -129,7 +129,6 @@ std::vector<Move> GetSortedLegalMoves(Game *g, bool generateQuietMoves) { } Move EngineGetBestMove(Game *b, const int depth) { - const int usedDepth = (depth != -1 ? depth : DEFAULT_DEPTH); const auto moves = GetSortedLegalMoves(b); if (moves.empty()) { std::cout << "Expected a position with legal moves"; @@ -145,7 +144,8 @@ Move EngineGetBestMove(Game *b, const int depth) { const float alpha = -INFINITY; const float beta = INFINITY; - const int eval = minimax(usedDepth - 1, b, alpha, beta); + const int eval = + minimax(depth <= 0 ? DEFAULT_DEPTH : depth, b, alpha, beta); UnMakeMove(undo, b); if (b->turn) { |
