From c2d26163b3a12e756388c1a5a14df6bab46a79d0 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 13 Mar 2012 14:06:32 +0100 Subject: [PATCH] Fix fall-back on -ncp mode When the requested engine could not be started, the user still had to wait for the feature timeout to expire before the UI was re-enabled, and the now-useless loading action would continue. In stead we now cancel any scheduled continuation, thaw the UI immediately, and switch the menus and gameMode to ncp straight away. --- backend.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index f420925..75b1529 100644 --- a/backend.c +++ b/backend.c @@ -8363,7 +8363,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. /* * If chess program startup fails, exit with an error message. - * Attempts to recover here are futile. + * Attempts to recover here are futile. [HGM] Well, we try anyway */ if ((StrStr(message, "unknown host") != NULL) || (StrStr(message, "No remote directory") != NULL) @@ -8377,7 +8377,14 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. _(cps->which), cps->program, cps->host, message); RemoveInputSource(cps->isr); if(appData.icsActive) DisplayFatalError(buf1, 0, 1); else { - if(cps == &first) appData.noChessProgram = TRUE; + if(cps == &first) { + appData.noChessProgram = TRUE; + gameMode = MachinePlaysBlack; ModeHighlight(); // kludge to unmark Machine Black menu + gameMode = BeginningOfGame; ModeHighlight(); + SetNCPMode(); + } + if(GetDelayedEvent()) CancelDelayedEvent(), ThawUI(); // [HGM] cancel remaining loading effort scheduled after feature timeout + DisplayMessage("", ""); // erase waiting message DisplayError(buf1, 0); } return; -- 1.7.0.4