X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;fp=UCI2WB.c;h=b901bbcbcba92bb1b9b6ae82c0a0b2a487756ade;hp=536eb44198a9557ec1f1bedb933f6623337d3d33;hb=1788d5e3e95e8b959a382171f31da23cc10d5ee3;hpb=56ec3542fa3d48cab43219310e235951a0978599 diff --git a/UCI2WB.c b/UCI2WB.c index 536eb44..b901bbc 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -460,7 +460,7 @@ GUI2Engine() else if(!strcmp(command, "pause")) { if(computer == stm) myTime -= GetTickCount() - startTime; suspended = 1 + (searching == 1); // remember if we were pondering, and stop search ignoring bestmove - StopPonder(searching); + if(searching) searching = 0, StopPonder(1); } else { //convert easy & hard to "option" after treating their effect on the adapter if(!strcmp(command, "easy")) { @@ -468,8 +468,8 @@ GUI2Engine() } else if(!strcmp(command, "hard")) { if(*canPonder) ponder = 1, sprintf(command, "option"), sprintf(line, "option %s=1\n", canPonder); else continue; - } else - if(!strcmp(command, "option")) { + } + else if(!strcmp(command, "option")) { if(sscanf(line+7, "UCI2WB debug output=%d", &debug) == 1) ; else if(sscanf(line+7, "ponder always=%d", &ponderAlways) == 1) ; else if(sscanf(line+7, "Floating Byoyomi=%d", &flob) == 1) ; else @@ -499,9 +499,8 @@ GUI2Engine() *qEnd++ = '\n'; Sync(WAKEUP); // make sure engine thread considers starting a search } else if(!strcmp(command, "resume")) { - searching = 0; if(suspended == 2) StartPonder(moveNr); // restart interrupted ponder search - suspended = 0; // causes thinking to start in normal way if on move or analyzing + suspended = 0; *qEnd++ = '\n'; Sync(WAKEUP); // causes search to start in normal way if on move or analyzing } else { if(searching == 3) { // command arrived during thinking; order abort for 'instant commands'