Process usermove in ponder input
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 1 Jun 2013 21:12:19 +0000 (23:12 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Mon, 21 Oct 2013 08:40:25 +0000 (10:40 +0200)
hachu.c

diff --git a/hachu.c b/hachu.c
index 79c5b75..609f05e 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -2306,6 +2306,15 @@ printf("# in (mode = %d,%d): %s\n", root, abortFlag, command);
         if(!strcmp(command, "put"))     { ReadSquare(inBuf+4, &lastPut); continue; }  // ditto\r
         if(!strcmp(command, "."))       { inBuf[0] = 0; return; } // ignore for now\r
         if(!strcmp(command, "lift"))    { inBuf[0] = 0; Highlight(inBuf+5); return; } // treat here\r
+        if(!root && !strcmp(command, "usermove")) {\r
+          abortFlag = !!strcmp(inBuf+9, ponderMoveText);\r
+          if(!abortFlag) { // ponder hit, continue as time-based search\r
+            SetSearchTimes(10*timeLeft + GetTickCount() - startTime); // add time we already have been pondering to total\r
+            if(lastRootIter > tlim1) abortFlag = 2; // abort instantly if we are in iteration we should not have started\r
+            inBuf[0] = 0; ponderMove = INVALID;\r
+            return;\r
+          }\r
+        }\r
         abortFlag = 1;\r
         return;\r
       }\r