Repair score printing with -serverMoves option
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 28 May 2010 09:05:00 +0000 (11:05 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 28 May 2010 09:05:00 +0000 (11:05 +0200)
A previous patch had moved MakeMove to before the update of pvInfoList,
so that the score/depth info would not appear in the file with moves.

backend.c

index b6a8edf..f5f9f99 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -7182,6 +7182,11 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h
        strcat(machineMove, "\n");
        strcpy(moveList[forwardMostMove], machineMove);
 
        strcat(machineMove, "\n");
        strcpy(moveList[forwardMostMove], machineMove);
 
+        /* [AS] Save move info*/
+        pvInfoList[ forwardMostMove ].score = programStats.score;
+        pvInfoList[ forwardMostMove ].depth = programStats.depth;
+        pvInfoList[ forwardMostMove ].time =  programStats.time; // [HGM] PGNtime: take time from engine stats
+
        MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/
 
         /* [AS] Adjudicate game if needed (note: remember that forwardMostMove now points past the last move) */
        MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/
 
         /* [AS] Adjudicate game if needed (note: remember that forwardMostMove now points past the last move) */
@@ -7241,10 +7246,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats.
        }
 #endif
 
        }
 #endif
 
-        /* [AS] Save move info and clear stats for next move */
-        pvInfoList[ forwardMostMove-1 ].score = programStats.score;
-        pvInfoList[ forwardMostMove-1 ].depth = programStats.depth;
-        pvInfoList[ forwardMostMove-1 ].time =  programStats.time; // [HGM] PGNtime: take time from engine stats
+        /* [AS] Clear stats for next move */
         ClearProgramStats();
         thinkOutput[0] = NULLCHAR;
         hiddenThinkOutputState = 0;
         ClearProgramStats();
         thinkOutput[0] = NULLCHAR;
         hiddenThinkOutputState = 0;