diff --git a/source/search.cpp b/source/search.cpp index 143cb1b..042ff7a 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -318,6 +318,7 @@ static SearchResults ID(Board &board, SearchParams params) { void SearchPosition(Board &board, SearchParams params) { searchStopped = false; nodes = 0; + pvLine.Clear(); auto currTime = std::chrono::high_resolution_clock::now(); SearchResults results = ID(board, params); diff --git a/source/search.h b/source/search.h index 3cdb3ec..9554d74 100644 --- a/source/search.h +++ b/source/search.h @@ -54,6 +54,11 @@ public: std::cout << ' '; } } + + void Clear() { + length[maxDepth] = {}; + table[maxDepth][maxDepth] = {}; + } }; SearchResults PVS(Board board, int depth, int alpha, int beta);