From: H.G. Muller Date: Fri, 23 Oct 2009 04:28:38 +0000 (-0700) Subject: NPS plays and pondering X-Git-Tag: v4.4.1.20091022~4 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4f1c0dc1aa35c8e1c00a868d29a9ce9d84f64411;p=xboard.git NPS plays and pondering Clock updating did not work correctly in node-based time controls when the engine was pondering. (It was not really meant for use with pondering. Oh well...) This patch checks if the engine reporting the node count is indeed thinking (as opposed to pondering). --- diff --git a/backend.c b/backend.c index 54f337d..4582baa 100755 --- a/backend.c +++ b/backend.c @@ -6945,9 +6945,12 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if(cps->nps == 0) ticklen = 10*time; // use engine reported time else ticklen = (1000. * u64ToDouble(nodes)) / cps->nps; // convert node count to time - if(WhiteOnMove(forwardMostMove)) + if(WhiteOnMove(forwardMostMove) && (gameMode == MachinePlaysWhite || + gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'w')) whiteTimeRemaining = timeRemaining[0][forwardMostMove] - ticklen; - else blackTimeRemaining = timeRemaining[1][forwardMostMove] - ticklen; + if(!WhiteOnMove(forwardMostMove) && (gameMode == MachinePlaysBlack || + gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) + blackTimeRemaining = timeRemaining[1][forwardMostMove] - ticklen; } /* Buffer overflow protection */