X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=2dacd1c2f37b3b9a18a66c1d340d041342f4bb31;hp=5a302a8d1b9d44286a39be48aeb25bcd69607ec0;hb=be2925b3c5ef79685f9290414a96efab18bf3a8a;hpb=321320b0814d5994640977cf96e015eba8ce22d5 diff --git a/src/uci.cpp b/src/uci.cpp index 5a302a8d..2dacd1c2 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -182,8 +182,7 @@ namespace { string token; SearchLimits limits; - Move searchMoves[MAX_MOVES] = { MOVE_NONE }; - Move* cur = searchMoves; + Move searchMoves[MAX_MOVES], *cur = searchMoves; int time[] = { 0, 0 }, inc[] = { 0, 0 }; while (up >> token) @@ -209,26 +208,23 @@ namespace { else if (token == "movetime") up >> limits.maxTime; else if (token == "searchmoves") - { while (up >> token) *cur++ = move_from_uci(pos, token); - - *cur = MOVE_NONE; - } } - assert(pos.is_ok()); - + *cur = MOVE_NONE; limits.time = time[pos.side_to_move()]; limits.increment = inc[pos.side_to_move()]; + assert(pos.is_ok()); + return think(pos, limits, searchMoves); } // perft() is called when engine receives the "perft" command. // The function calls perft() passing the required search depth - // then prints counted nodes and elapsed time. + // then prints counted leaf nodes and elapsed time. void perft(Position& pos, UCIParser& up) {