X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;fp=UCI2WB.c;h=81a7e5fe62b75e8b8a1eae8b1807c2e733cfe550;hp=41c71c81f97880a7f7de80da1b5d1f675a32d47d;hb=97e74bb8982f9fd78654a4f2b8a7619969a3414a;hpb=990ae69c6d5ff8468541372acc4c6fcb854f64e2 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(); } }