From: H.G. Muller Date: Mon, 10 Jan 2011 19:36:48 +0000 (+0100) Subject: Fix time in PGN info X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a8aa209e5f4ae95e54ebe54d6cf23fccfe75d1a8;p=xboard.git 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. --- 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();