X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=a4a73fbf3eea557e05d1e4da9c86288a325c29fc;hp=c9ecbf234fc16f993582e30bf1a9e62aac3ab1d8;hb=00d9fe8af09891e82d66f88c48b513d6a7326f2a;hpb=fb50e16cdda68e05d08ed3992a04e5a396a461e3 diff --git a/src/uci.cpp b/src/uci.cpp index c9ecbf23..a4a73fbf 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -27,7 +27,6 @@ #include #include -#include "book.h" #include "evaluate.h" #include "misc.h" #include "move.h" @@ -35,7 +34,6 @@ #include "position.h" #include "san.h" #include "search.h" -#include "uci.h" #include "ucioption.h" using namespace std; @@ -121,10 +119,7 @@ namespace { cout << "uciok" << endl; } else if (token == "ucinewgame") - { - set_option_value("New Game", "true"); pos.from_fen(StartPositionFEN); - } else if (token == "isready") cout << "readyok" << endl; else if (token == "position") @@ -233,16 +228,22 @@ namespace { while (uip >> token && token != "value") name += (" " + token); + if (Options.find(name) == Options.end()) + { + cout << "No such option: " << name << endl; + return; + } + if (token != "value" || !(uip >> value)) { - set_option_value(name, "true"); + Options[name].set_value("true"); return; } while (uip >> token) value += (" " + token); - set_option_value(name, value); + Options[name].set_value(value); }