diff --git a/source/uci.cpp b/source/uci.cpp index d7e76de..4fc61b7 100644 --- a/source/uci.cpp +++ b/source/uci.cpp @@ -12,7 +12,7 @@ #include "perft.h" #include "utils.h" -static void ParsePosition(Board &board, std::string_view command) { +static void ParsePosition(Board &board, std::string_view command, SEARCH::SearchContext& ctx) { if (command.find("startpos") != std::string::npos) { board.SetByFen(StartingFen); } @@ -33,6 +33,7 @@ static void ParsePosition(Board &board, std::string_view command) { for (std::string_view move : moves) { bool isLegal = board.MakeMove(UTILS::parseMove(board, move)); + ctx.positionHistory[board.positionIndex] = board.hashKey; } } @@ -124,7 +125,7 @@ void UCILoop(Board &board) { // parse UCI "position" command if (input.find("position") != std::string::npos) { - ParsePosition(board, input); + ParsePosition(board, input, ctx); continue; }