X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=c9120ddbd7728c1b7dfc72cf6b6930118dc2f594;hp=b03752edc4220e865d4087642e1523e53050d42a;hb=afadc33fb430abd2ba2783a62180cf971b13652f;hpb=8f59de48f559e477dc383d5b51a0b842986758d0 diff --git a/src/uci.cpp b/src/uci.cpp index b03752ed..c9120ddb 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; @@ -228,6 +229,9 @@ namespace { 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); } } } @@ -247,11 +251,13 @@ namespace { if (token == "name") { uip >> name; - uip >> token; - while (!uip.eof() && token != "value") + while (!uip.eof()) { - name += (" " + token); - uip >> token; + uip >> token; + if (token == "value") + break; + + name += (" " + token); } if (token == "value") { @@ -321,6 +327,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); }