X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=6ce3bf8567447fa531861af74ff25fe989ccb284;hp=4aade3b66bb99cbcdb261089519443f7c8e48c11;hb=a9e55d43262d11a916bdfa68cd1de0174d884cd3;hpb=d3600c39a745179ed6b094b305d0645e83a1ee86 diff --git a/src/uci.cpp b/src/uci.cpp index 4aade3b6..6ce3bf85 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -22,6 +22,7 @@ //// Includes //// +#include #include #include #include @@ -219,15 +220,18 @@ namespace { if (token == "moves") { Move move; - UndoInfo u; + StateInfo st; while (!uip.eof()) { uip >> token; move = move_from_string(RootPosition, token); - RootPosition.do_move(move, u); + RootPosition.do_move(move, st); if (RootPosition.rule_50_counter() == 0) RootPosition.reset_game_ply(); } + // Our StateInfo st is about going out of scope, + // so save its content before they disappear. + RootPosition.setStartState(st); } } } @@ -321,6 +325,8 @@ namespace { if (moveTime) infinite = true; // HACK + assert(RootPosition.is_ok()); + think(RootPosition, infinite, ponder, RootPosition.side_to_move(), time, inc, movesToGo, depth, nodes, moveTime, searchMoves); }