X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=58f3dbc0c663a6cd0412f913fd556191048d1c2e;hp=763db556654e4c87828854bc7290d056ba8038da;hb=6becc8144686b9a40d8dc9d5e0ce4dec28cbcb6a;hpb=ebe8009affa34708bac1e8b69cf5b925ffe5cc82 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 763db556..58f3dbc0 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -134,18 +134,20 @@ UCIOption::UCIOption(int v, int minv, int maxv, Fn* f) : type("spin"), min(minv) /// check for option's limits, but we could receive the new value directly from /// the user by console window, so let's check the bounds anyway. -void UCIOption::operator=(const string& v) { +UCIOption& UCIOption::operator=(const string& v) { assert(!type.empty()); if ( (type != "button" && v.empty()) || (type == "check" && v != "true" && v != "false") || (type == "spin" && (atoi(v.c_str()) < min || atoi(v.c_str()) > max))) - return; + return *this; if (type != "button") currentValue = v; if (on_change) (*on_change)(*this); + + return *this; }