void\r
GUI2Engine()\r
{\r
- char line[256], command[256], *p, *q, *r;\r
+ char line[256], command[256], *p, *q, *r, mySide;\r
\r
while(1) {\r
int i, x;\r
DPRINT("# start search\n");\r
LoadPos(moveNr); fflush(stdout); // load position\r
// and set engine thinking (note USI swaps colors!)\r
- startTime = GetTickCount();\r
+ startTime = GetTickCount(); mySide = stm; // remember side we last played for\r
if(computer == ANALYZE) {\r
fprintf(toE, "\ngo infinite"); DPRINT("\n# go infinite");\r
if(sm & 1) { // some moves are disabled\r
else if(!strcmp(command, "sd")) sscanf(line, "sd %d", &depth);\r
else if(!strcmp(command, "st")) sscanf(line, "st %d", &sTime), sTime = 1000*sTime - 30, inc = 0, sTime /= unit;\r
else if(!strcmp(command, "offer")) drawOffer = 1;\r
+ else if(!strcmp(command, "result")) { if(sc == 's') fprintf(toE, "gameover %s\n", line[8] == '/' ? "draw" : (line[7] == '0') == mySide ? "win" : "lose"); }\r
else if(!strcmp(command, "quit")) fprintf(toE, "quit\n"), fflush(toE), exit(0);\r
}\r
}\r