Set return move already when we get new PV
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 21:10:04 +0000 (22:10 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 21:10:04 +0000 (22:10 +0100)
Returning the move at the endof the iteration did not work if the
iteration took an early exit.

dropper.c

index 0ba2078..7b65c34 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1338,6 +1338,7 @@ printf("%d:%d:%d %2d. %08x %c%d%c%d %6d %6d %6d\n",ply,depth,iterDepth,curMove,m
                        printf("%d %d %d %d", iterDepth, xbScore, ReadClock(0)/10, nodeCount);
                        for(tail=pvStart; *tail; tail++) printf(" %s", MoveToText(*tail));
                        printf("\n"); fflush(stdout);
+                       ff->move = moveStack[bestNr];
                    }
                }
            }
@@ -1353,7 +1354,6 @@ if(PATH)printf("%d:%d:%d iter end, max=%d, alpha=%d start=%d\n", ply, depth,iter
        alpha = startAlpha; // reset alpha for next iteration
 
        // put best in front
-       ff->move = moveStack[bestNr];
        if(bestNr > m.firstMove) {
            int bestMove = moveStack[bestNr];
            if(bestNr == m.firstMove+1) moveStack[bestNr] = moveStack[m.firstMove]; else m.firstMove--; // swap first two, or prepend duplicat