X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=306819bb3e46f680544f4a0b0fea69a9f6921782;hp=57a31ad64f11f4bb0ef788a374ba67a3bd76e150;hb=bb3427ca85bdb20b4c8af12b63f635d03c5e9146;hpb=6809b57cfc47321826f01253241afef8b4380612 diff --git a/src/uci.cpp b/src/uci.cpp index 57a31ad6..306819bb 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -72,7 +72,6 @@ void uci_loop() { quit = (token == "quit"); Search::Signals.stop = true; Threads[0].wake_up(); // In case is waiting for stop or ponderhit - Threads.wait_end_of_search(); // Block here until search finishes } else if (cmd == "ponderhit") @@ -206,18 +205,16 @@ namespace { void go(Position& pos, istringstream& is) { string token; + Search::LimitsType limits; + std::vector searchMoves; int time[] = { 0, 0 }, inc[] = { 0, 0 }; - memset(&Search::Limits, 0, sizeof(Search::Limits)); - Search::RootMoves.clear(); - Search::RootPosition = &pos; - while (is >> token) { if (token == "infinite") - Search::Limits.infinite = true; + limits.infinite = true; else if (token == "ponder") - Search::Limits.ponder = true; + limits.ponder = true; else if (token == "wtime") is >> time[WHITE]; else if (token == "btime") @@ -227,23 +224,22 @@ namespace { else if (token == "binc") is >> inc[BLACK]; else if (token == "movestogo") - is >> Search::Limits.movesToGo; + is >> limits.movesToGo; else if (token == "depth") - is >> Search::Limits.maxDepth; + is >> limits.maxDepth; else if (token == "nodes") - is >> Search::Limits.maxNodes; + is >> limits.maxNodes; else if (token == "movetime") - is >> Search::Limits.maxTime; + is >> limits.maxTime; else if (token == "searchmoves") while (is >> token) - Search::RootMoves.push_back(move_from_uci(pos, token)); + searchMoves.push_back(move_from_uci(pos, token)); } + searchMoves.push_back(MOVE_NONE); + limits.time = time[pos.side_to_move()]; + limits.increment = inc[pos.side_to_move()]; - Search::RootMoves.push_back(MOVE_NONE); - Search::Limits.time = time[pos.side_to_move()]; - Search::Limits.increment = inc[pos.side_to_move()]; - - Threads.start_thinking(); + Threads.start_thinking(pos, limits, searchMoves, true); }