From a8aa209e5f4ae95e54ebe54d6cf23fccfe75d1a8 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 10 Jan 2011 20:36:48 +0100 Subject: [PATCH] Fix time in PGN info Saving of the thinking time in the PGN was broken by the patch that removed the race condition in the clock switching, because that moved the incrementing of forwardMostMove to behind the code that used fmm to index pvInfoList. As a result the time was stored in the slot for the opponent's previous move. The value is corrected now. --- backend.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend.c b/backend.c index 9629342..5224018 100644 --- a/backend.c +++ b/backend.c @@ -14545,15 +14545,15 @@ SwitchClocks(int newMoveNr) if(blackNPS >= 0) lastTickLength = 0; blackTimeRemaining -= lastTickLength; /* [HGM] PGNtime: save time for PGN file if engine did not give it */ -// if(pvInfoList[forwardMostMove-1].time == -1) - pvInfoList[forwardMostMove-1].time = // use GUI time +// if(pvInfoList[forwardMostMove].time == -1) + pvInfoList[forwardMostMove].time = // use GUI time (timeRemaining[1][forwardMostMove-1] - blackTimeRemaining)/10; } else { if(whiteNPS >= 0) lastTickLength = 0; whiteTimeRemaining -= lastTickLength; /* [HGM] PGNtime: save time for PGN file if engine did not give it */ -// if(pvInfoList[forwardMostMove-1].time == -1) - pvInfoList[forwardMostMove-1].time = +// if(pvInfoList[forwardMostMove].time == -1) + pvInfoList[forwardMostMove].time = (timeRemaining[0][forwardMostMove-1] - whiteTimeRemaining)/10; } flagged = CheckFlags(); -- 1.7.0.4