Fix setting oldBest
[hachu.git] / hachu.c
diff --git a/hachu.c b/hachu.c
index 9a8c518..918ef49 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -1644,6 +1644,7 @@ if(PATH) /*pboard(board),pmap(attacks, BLACK),*/printf("search(%d) {%d,%d} eval=
   replyDep = (depth < 1 ? depth-1 : iterDep);\r
   while(++iterDep <= depth || iterDep == 1) {\r
 if(flag && depth>= 0) printf("iter %d:%d\n", depth,iterDep),fflush(stdout);\r
+    oldBest = bestScore;\r
     iterAlpha = alpha; bestScore = -INF; bestMoveNr = 0; resDep = 60;\r
     for(curMove = firstMove; ; curMove++) { // loop over moves\r
 if(flag && depth>= 0) printf("phase=%d: first/curr/last = %d / %d / %d\n", phase, firstMove, curMove, msp);fflush(stdout);\r
@@ -2360,7 +2361,7 @@ pboard(board);
             PrintResult(stm, score);\r
           } else {\r
             stm = MakeMove2(stm, move);  // assumes MakeMove returns new side to move\r
-            gameMove[moveNr++] = move;  // remember game\r
+            gameMove[moveNr++] = move;   // remember game\r
             printf("move %s\n", MoveToText(move, 1));\r
             listEnd = 0;\r
             continue;\r