From 4def9a500291c53f4310761baad1308e21e44081 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 5 Dec 2016 19:47:05 +0100 Subject: [PATCH] Make sure we resign when engine reports we are checkmated When a UCI engine is set thinking in a checkmated position, the PV necessarily is empty, and instead of printing an empty 'pv' field in as pv info, it might omit it alltogether. So we even accept a 'mate 0' score when there is no PV, so that a following 'bestmove 0000' will be interpreted as a loss (sending 'resign'), rather than a draw (sending 1/2-1/2). --- UCI2WB.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index f094d10..8e61b41 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -327,6 +327,7 @@ Engine2GUI() if(p = strstr(line+4, " currmovenumber ")) sscanf(p+16,"%d", &currNr); if(pv = strstr(line+4, " pv ")) // convert PV info to WB thinking output printf("%3d %6d %6d %10d %s", lastDepth=d, lastScore=s, t, n, Convert(pv+4)); + else if(s == -100000) lastScore = s; // when checkmated score is valid even without PV (which might not come) } } else if(!strcmp(command, "option")) { // USI option: extract data fields -- 1.7.0.4