Fix initialization of engine state
[xboard.git] / backend.c
index 999fcfd..8916211 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -796,7 +796,11 @@ InitEngine(ChessProgramState *cps, int n)
 
     /* [HGM] debug */
     cps->debug = FALSE;
+
     cps->supportsNPS = UNKNOWN;
+    cps->memSize = FALSE;
+    cps->maxCores = FALSE;
+    cps->egtFormats[0] = NULLCHAR;
 
     /* [HGM] options */
     cps->optionSettings  = appData.engOptions[n];
@@ -5335,12 +5339,12 @@ LoadMultiPV(int x, int y, char *buf, int index, int *start, int *end)
        buf[index] = 0;
        if(lineStart == 0 && gameMode == AnalyzeMode && (multi = MultiPV(&first)) >= 0) {
                int n = first.option[multi].value;
-               if(origIndex < 10) { if(n>1) n--; } else if(origIndex > index - 6) n++;
+               if(origIndex > 17 && origIndex < 24) { if(n>1) n--; } else if(origIndex > index - 6) n++;
                snprintf(buf2, MSG_SIZ, "option MultiPV=%d\n", n);
                if(first.option[multi].value != n) SendToProgram(buf2, &first);
                first.option[multi].value = n;
                *start = *end = 0;
-               return TRUE;
+               return FALSE;
        }
        ParsePV(buf+startPV, FALSE, gameMode != AnalyzeMode);
        *start = startPV; *end = index-1;