Fix periodic updates master
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 29 May 2018 15:09:51 +0000 (17:09 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 29 May 2018 15:09:51 +0000 (17:09 +0200)
The number of moves yet to go was off by one. In addition we now ignore
zapped moves at the end of the list, so it will be obvious when the engine
is working on the last move of the iteration.

dropper.c

index efe22c1..36e0fa5 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1872,8 +1872,9 @@ printf("# command: %s\n", inBuf);
     if(!strcmp(command, "nopost"))  { postThinking = OFF;return 0; }
     if(!strcmp(command, "random"))  { randomize = ON;    return 0; }
     if(!strcmp(command, "."))       { // periodic update request;
+      while(rootLast > rootFirst && !moveStack[rootLast]) rootLast--;
       printf("stat01: %d %d %d %d %d %s\n", ReadClock(0, 1)/10, nodeCount, rootPly,
-            rootLast - rootCurrent + 1, rootLast - rootFirst, MoveToText(moveStack[rootCurrent]));
+            rootLast - rootCurrent, rootLast - rootFirst, MoveToText(moveStack[rootCurrent]));
       fflush(stdout); return 0;
     }
     if(!strcmp(command, "option")) { // setting of engine-define option; find out which