From: H.G.Muller Date: Sat, 8 Dec 2018 13:24:10 +0000 (+0100) Subject: Refrain from starting analysis search if all moves excluded X-Git-Tag: v4.0~10 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=97e74bb8982f9fd78654a4f2b8a7619969a3414a;p=uci2wb.git Refrain from starting analysis search if all moves excluded LaunchSearch() now tests for any moves being still enabled before starting an analysis search. (If there aren't sm == 1.) This means the last reason to skip LaunchSearch() after DoCommand() has disappeared. --- diff --git a/UCI2WB.c b/UCI2WB.c index 41c71c8..81a7e5f 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -415,7 +415,7 @@ Move4Engine(char *m) } } -int DoCommand (); +void DoCommand (); char mySide; volatile char queue[10000], *qStart, *qEnd; @@ -424,7 +424,7 @@ LaunchSearch() { int i; - if((computer == stm || computer == ANALYZE && !searching) && !suspended) { + if((computer == stm || computer == ANALYZE && !searching && sm != 1) && !suspended) { DPRINT("# start search\n"); LoadPos(moveNr); fflush(stdout); // load position // and set engine thinking (note USI swaps colors!) @@ -520,14 +520,14 @@ GUI2Engine() } } -int +void DoCommand () { char line[1024], command[256], *p, *q, *r, type[99]; int i; p=line; while(qStart < qEnd && (*p++ = *qStart++) != '\n') {} *p = 0; - if(line[0] == '\n') return 0; + if(line[0] == '\n') return; sscanf(line, "%s", command); if(!strcmp(command, "new")) { @@ -594,7 +594,6 @@ DoCommand () int all = !strcmp(line+8, "all"), in = command[1] == 'n'; inex = 1; line[strlen(line)-1] = sm = 0; // strip LF and clear sm flag for(i=1; i 1) HandleEngineOutput(); // this could leave us (or fall through) pondering while(qStart == qEnd && searching) HandleEngineOutput(); // relay ponder output until command arrives Sync(PAUSE); // possibly wait for command silently if engine is idle - if(!DoCommand()) LaunchSearch(); + DoCommand(); LaunchSearch(); } }