From 77a5189fa223ed2a484e1715ad760a8396a7ad7e Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 30 Nov 2010 21:25:07 +0100 Subject: [PATCH] Fix sub-variation display with negative score The test if the displayed score was the pvInfo score failed for negative scores, because floats are truncated towards zero. So the previous fix of spurious score/depth info was not working when the score was negative. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 193ab42..847b609 100644 --- a/backend.c +++ b/backend.c @@ -13302,7 +13302,7 @@ ReplaceComment(index, text) if(index && sscanf(text, "%f/%d", &score, &len) == 2 && pvInfoList[index-1].depth == len && - pvInfoList[index-1].score == (int) (score*100 + 0.5) && + fabs(pvInfoList[index-1].score - score*100.) < 0.5 && (p = strchr(text, '\n'))) text = p; // [HGM] strip off first line with PV info, if any while (*text == '\n') text++; len = strlen(text); -- 1.7.0.4