From: H.G. Muller Date: Tue, 17 Apr 2012 08:51:02 +0000 (+0200) Subject: Fix second-engine variant test X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=19ba39ea3fba5ff50a6624575b262db203ada9d4;p=xboard.git Fix second-engine variant test The test whether the second engine supports the selected variant took place before the second engine was loaded, thus always coming to the conclusion that the variant was not supported, and aborting the TwoMachines command. The test is now moved to after second-engine loading (but before its initialization, where non-supporting would become a fatal error). --- diff --git a/backend.c b/backend.c index 14563fa..0a8b682 100644 --- a/backend.c +++ b/backend.c @@ -13602,11 +13602,6 @@ TwoMachinesEvent P((void)) if (appData.noChessProgram) return; - if(second.protocolVersion >= 2 && !strstr(second.variants, VariantName(gameInfo.variant))) { - DisplayError("second engine does not play this", 0); - return; - } - switch (gameMode) { case TwoMachinesPlay: return; @@ -13645,6 +13640,12 @@ TwoMachinesEvent P((void)) ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); return; } + + if(second.protocolVersion >= 2 && !strstr(second.variants, VariantName(gameInfo.variant))) { + DisplayError("second engine does not play this", 0); + return; + } + if(!stalling) { InitChessProgram(&second, FALSE); // unbalances ping of second engine SendToProgram("force\n", &second);