char *pg_name=Star[0];\r
polyglot_set_option(pg_name,value);\r
}else{\r
- start_protected_command();\r
- if(!uci_send_option(Uci, name, "%s", value)){\r
+ option_t *opt=option_find(Uci->option,name);\r
+ if(opt){\r
+ if(my_string_case_equal(opt->type,"check")){\r
+ value=my_string_equal(value,"1")?"true":"false";\r
+ }\r
+ start_protected_command();\r
+ uci_send_option(Uci, name, "%s", value);\r
+ end_protected_command();\r
+ }else{\r
gui_send(GUI,"Error (unknown option): %s",name); \r
}\r
- end_protected_command();\r
}\r
} else if (match(string,"option *")){\r
char *name=Star[0];\r
gui_send(GUI,"1-0 {polyglot: resign"\r
" (illegal engine move black)}");\r
}\r
+ board_disp(board);\r
XB->result = TRUE;\r
mess();\r
}\r
// send_info()\r
\r
static void send_info() {\r
- if (XB->post) {\r
- gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth>0?Uci->best_depth:1,\r
+ int min_depth;\r
+ if(option_get_bool(Option,"WbWorkArounds2")){\r
+ // Silly bug in some versions of WinBoard.\r
+ // depth <=1 clears the engine output window.\r
+ // Why shouldn't an engine be allowed to send info at depth 1?\r
+ min_depth=2;\r
+ }else{\r
+ min_depth=1;\r
+ }\r
+ gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth>min_depth?Uci->best_depth:min_depth,\r
0,0,0.0,0,Uci->info); \r
- } \r
}\r
\r
// send_pv()\r