From 4f1c0dc1aa35c8e1c00a868d29a9ce9d84f64411 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 22 Oct 2009 21:28:38 -0700 Subject: [PATCH] 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). --- backend.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) 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 */ -- 1.7.0.4