Fix display state after failed analysis attempt
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 24 Aug 2011 08:30:46 +0000 (10:30 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 26 Aug 2011 11:04:12 +0000 (13:04 +0200)
When an engine responded to the "analyze" command with an "unknown command"
message, a Reset was done without altering the display, causing a
discrepancy between display and internal state, which caused confusion
when it finally corrected itself. I replaced the Reset call by an
EditGameEvent call, to preserve the loaded game. The Reset was presumably
used to allow for the case where the engine would be so upset by the
analyze command that it needed to be reset by a "new" command, but this
seems overly paranoic for an engine that just recognized the command
as an unknown one.

backend.c

index a49155c..f4ac7f9 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -8268,7 +8268,8 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats.
        if (StrStr(message, "analyze")) {
            cps->analysisSupport = FALSE;
            cps->analyzing = FALSE;
-           Reset(FALSE, TRUE);
+//         Reset(FALSE, TRUE); // [HGM] this caused discrepancy between display and internal state!
+           EditGameEvent(); // [HGM] try to preserve loaded game
            snprintf(buf2,MSG_SIZ, _("%s does not support analysis"), cps->tidy);
            DisplayError(buf2, 0);
            return;