X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=UCI2WB.c;h=adfb3d690ce208431e05ad06e1052e5d8130e870;hb=e4503efed01f5923d70288d6a7f50de29c27f0b7;hp=7d915e821777765398d0e85b3c64214d3aa24e1a;hpb=1e8b2a6e137452edec15c70394d22bf864a5d54f;p=uci2wb.git diff --git a/UCI2WB.c b/UCI2WB.c index 7d915e8..adfb3d6 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -428,7 +428,8 @@ GUI2Engine() sscanf(line, "%s", command); if(!strcmp(command, "offer")) { drawOffer = 1; goto nomove; } // backlogged anyway, so this can be done instantly if(think) { // command arrived during thinking; order abort for 'instant commands' - if(!strcmp(command, "quit") || !strcmp(command, "force") || !strcmp(command, "?")) { EPRINT((f, "# stop\n")); fflush(toE); } + if(!strcmp(command, "?") || !strcmp(command, "quit") || + !strcmp(command, "force") || !strcmp(command, "result")) { EPRINT((f, "# stop\n")); fflush(toE); } Sync(PAUSE); // block processing of input during thinking } if(!strcmp(command, "new")) { @@ -551,7 +552,10 @@ GUI2Engine() else if(!strcmp(command, "st")) sscanf(line, "st %d", &sTime), sTime = 1000*sTime - 30, inc = 0, sTime /= unit; else if(!strcmp(command, "name")) { if(namOpt) EPRINT((f, "# setoption name UCI_Opponent value none none %s %s", comp ? "computer" : "human", line+5)) } else if(!strcmp(command, "computer")) comp = 1; - else if(!strcmp(command, "result")) { if(sc == 's') EPRINT((f, "# gameover %s\n", line[8] == '/' ? "draw" : (line[7] == '0') == mySide ? "win" : "lose")) } + else if(!strcmp(command, "result")) { + if(sc == 's') EPRINT((f, "# gameover %s\n", line[8] == '/' ? "draw" : (line[7] == '0') == mySide ? "win" : "lose")) + computer = NONE; + } else if(!strcmp(command, "quit")) { EPRINT((f, "# quit\n")) fflush(toE), exit(atoi(line+4)); } } }