From: H.G.Muller Date: Mon, 5 Dec 2016 18:47:05 +0000 (+0100) Subject: Make sure we resign when engine reports we are checkmated X-Git-Tag: v4.0~42 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4def9a500291c53f4310761baad1308e21e44081;p=uci2wb.git 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). --- 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