}\r
}\r
\r
-\r
+void\r
+IsReady ()\r
+{\r
+ EPRINT((f, "# isready\n")) fflush(toE);\r
+ HandleEngineOutput(); // wait for readyok\r
+}\r
\r
void\r
DoCommand ()\r
oldMem = memory;\r
// we can set other options here\r
if(varOpt && strstr(varList, ",normal")) EPRINT((f, "# setoption name UCI_Variant value chess\n"))\r
- EPRINT((f, "# isready\n")) fflush(toE);\r
- HandleEngineOutput(); // wait for readyok\r
+ IsReady();\r
if(sc == 'x') { if(newGame) EPRINT((f, "# setoption newgame\n")) } else // optional in UCCI\r
- EPRINT((f, "# u%cinewgame\n", sc)) fflush(toE);\r
+ { EPRINT((f, "# u%cinewgame\n", sc)) fflush(toE); if(sc != 's') IsReady(); } // avoid isready in USI\r
}\r
else if(!strcmp(command, "e")) { strcpy(move[moveNr++], type); stm ^= WHITE|BLACK; return; }\r
else if(!strcmp(command, "option")) {\r