Make sure we resign when engine reports we are checkmated
[uci2wb.git] / UCI2WB.c
index f094d10..8e61b41 100644 (file)
--- a/UCI2WB.c
+++ b/UCI2WB.c
@@ -327,6 +327,7 @@ Engine2GUI()
                if(p = strstr(line+4, " currmovenumber ")) sscanf(p+16,"%d", &currNr);\r
                if(pv = strstr(line+4, " pv ")) // convert PV info to WB thinking output\r
                    printf("%3d  %6d %6d %10d %s", lastDepth=d, lastScore=s, t, n, Convert(pv+4));\r
+               else if(s == -100000) lastScore = s; // when checkmated score is valid even without PV (which might not come)\r
            }\r
        }\r
        else if(!strcmp(command, "option")) { // USI option: extract data fields\r