StopPonder(int pondering)\r
{\r
if(!pondering) return;\r
- pause = 1;\r
+ pause = 2;\r
fprintf(toE, "stop\n"); fflush(toE); DPRINT("# stop\n"); // note: 'pondering' remains set until engine acknowledges 'stop' with 'bestmove'\r
Sync(PAUSE); // wait for engine to acknowledge 'stop' with 'bestmove'.\r
}\r
if(sscanf(line, "%s", command) != 1) continue;\r
if(!strcmp(command, "bestmove")) {\r
if(pause) { pondering = pause = 0; Sync(WAKEUP); continue; } // bestmove was reply to ponder miss or analysis result; ignore.\r
+ else if(pondering) { pondering = 0; printf("%d 0 0 0 UCI violation! Engine moves during ponder\n", lastDepth+1); continue; } // ignore ponder search\r
// move was a move to be played\r
if(p = strstr(line+8, " draw")) *p = 0, printf("offer draw\n"); // UCCI\r
if(strstr(line+9, "resign")) { printf("resign\n"); computer = NONE; }\r