X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=48459757dda217aaf117fc5fbc60211722555488;hp=4aade3b66bb99cbcdb261089519443f7c8e48c11;hb=72c7595f8ac72c7831ee319b8b0bc46404c5fc27;hpb=d3600c39a745179ed6b094b305d0645e83a1ee86 diff --git a/src/uci.cpp b/src/uci.cpp index 4aade3b6..48459757 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -22,6 +22,7 @@ //// Includes //// +#include #include #include #include @@ -169,7 +170,7 @@ namespace { } else if (token == "key") { - std::cout << "key: " << RootPosition.get_key() + std::cout << "key: " << std::hex << RootPosition.get_key() << " material key: " << RootPosition.get_material_key() << " pawn key: " << RootPosition.get_pawn_key() << std::endl; @@ -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); }