X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=UCI2WB.c;h=9f1ad06c419ed64bdb109368c51d1d7b362fd1df;hb=768046d29eff91d4afbcea23dcb2a623a6a747c9;hp=2f450e83347244cb35849101983d3ba5f3ef1c9d;hpb=bc61b527999e40d827ec95bd84edaf0090898973;p=uci2wb.git diff --git a/UCI2WB.c b/UCI2WB.c index 2f450e8..9f1ad06 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -157,7 +157,7 @@ void StopPonder(int pondering) { if(!pondering) return; - pause = 2; + pause = 1; fprintf(toE, "stop\n"); fflush(toE); DPRINT("# stop\n"); // note: 'pondering' remains set until engine acknowledges 'stop' with 'bestmove' Sync(PAUSE); // wait for engine to acknowledge 'stop' with 'bestmove'. } @@ -402,10 +402,10 @@ GUI2Engine() oldMem = memory; // we can set other options here if(sc == 'x') { if(newGame) fprintf(toE, "setoption newgame\n"); } else // optional in UCCI - fprintf(toE, "u%cinewgame\n", sc); fflush(toE); pause = 1; // wait for option settings to take effect fprintf(toE, "isready\n"); fflush(toE); Sync(PAUSE); // wait for readyok + fprintf(toE, "u%cinewgame\n", sc); fflush(toE); } else if(!strcmp(command, "usermove")) { sscanf(line, "usermove %s", command); // strips off linefeed @@ -417,6 +417,7 @@ GUI2Engine() char *draw = drawOffer ? " draw" : ""; drawOffer = 0; pondering = 0; moveNr++; startTime = GetTickCount(); // clock starts running now fprintf(toE, "ponderhit%s\n", draw); DPRINT("# ponderhit%s\n", draw); + fflush(toE); fflush(stdout); pause = 2; Sync(PAUSE); // block input during thinking goto nomove; } StopPonder(1);