X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard2uci.c;h=1a4103ceff66cf11d8150798cab0626f8d63badd;hb=aaf072500213db1bed274a2dd8ebe711f21ab898;hp=97c7b732e1881fd7fd9a21dcbdac6319e1ddf8c7;hpb=a0f731f21d6aa26dbf7246039a1c66c2ade0533f;p=polyglot.git diff --git a/xboard2uci.c b/xboard2uci.c index 97c7b73..1a4103c 100644 --- a/xboard2uci.c +++ b/xboard2uci.c @@ -454,11 +454,17 @@ void xboard2uci_gui_step(char string[]) { char *pg_name=Star[0]; polyglot_set_option(pg_name,value); }else{ - start_protected_command(); - if(!uci_send_option(Uci, name, "%s", value)){ + option_t *opt=option_find(Uci->option,name); + if(opt){ + if(my_string_case_equal(opt->type,"check")){ + value=my_string_equal(value,"1")?"true":"false"; + } + start_protected_command(); + uci_send_option(Uci, name, "%s", value); + end_protected_command(); + }else{ gui_send(GUI,"Error (unknown option): %s",name); } - end_protected_command(); } } else if (match(string,"option *")){ char *name=Star[0]; @@ -740,6 +746,7 @@ void xboard2uci_engine_step(char string[]) { gui_send(GUI,"1-0 {polyglot: resign" " (illegal engine move black)}"); } + board_disp(board); XB->result = TRUE; mess(); } @@ -1190,11 +1197,17 @@ static void search_update() { if (State->state == THINK || State->state == PONDER || State->state == ANALYSE) { + // [VdB] moved up as we need the move number + + game_get_board(Game,Uci->board); + // opening book - if (State->state == THINK && option_get_bool(Option,"Book")) { + if (State->state == THINK && + option_get_bool(Option,"Book") && + Uci->board->move_nbboard); move = book_move(Uci->board,option_get_bool(Option,"BookRandom")); @@ -1462,10 +1475,17 @@ static void send_board(int extra_move) { // send_info() static void send_info() { - if (XB->post) { - gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth>0?Uci->best_depth:1, + int min_depth; + if(option_get_bool(Option,"WbWorkArounds2")){ + // Silly bug in some versions of WinBoard. + // depth <=1 clears the engine output window. + // Why shouldn't an engine be allowed to send info at depth 1? + min_depth=2; + }else{ + min_depth=1; + } + gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth>min_depth?Uci->best_depth:min_depth, 0,0,0.0,0,Uci->info); - } } // send_pv()