diff --git a/source/search.cpp b/source/search.cpp index 7e1802f..dd30f21 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -19,7 +19,7 @@ inline PVLine pvLine; Stopwatch sw; void InitLMRTable() { - for (int depth = 0; depth < MAX_DEPTH; depth++) { + for (int depth = 0; depth <= MAX_DEPTH; depth++) { for (int move = 0; move < MAX_MOVES; move++) { if (depth == 0 || move == 0) { lmrTable[depth][move] = 0; @@ -341,7 +341,7 @@ static SearchResults ID(Board &board, SearchParams params) { int elapsed = 0; sw.Restart(); - for (int depth = 1; depth <= 99; depth++) { + for (int depth = 1; depth <= MAX_DEPTH; depth++) { timeToSearch = std::max((fullTime / 20) + (inc / 2), 4); int softTime = timeToSearch * 0.65; diff --git a/source/search.h b/source/search.h index 9a162c1..f286246 100644 --- a/source/search.h +++ b/source/search.h @@ -21,7 +21,7 @@ inline bool searchStopped = false; // [id][ply] inline int killerMoves[2][64]; -inline int lmrTable[MAX_DEPTH][MAX_MOVES]; +inline int lmrTable[MAX_DEPTH+1][MAX_MOVES]; void InitLMRTable();