From: H.G. Muller Date: Sun, 1 Sep 2013 20:11:30 +0000 (+0200) Subject: Fix variant choice for second engine X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=44545b87e12b58945eddcbc76c1827bead814aae;p=xboard.git Fix variant choice for second engine --- diff --git a/backend.c b/backend.c index 78e8431..46e888e 100644 --- a/backend.c +++ b/backend.c @@ -2011,7 +2011,7 @@ char *variantNames[] = VARIANT_NAMES; char * VariantName (VariantClass v) { - if(v == VariantUnknown) return engineVariant; + if(v == VariantUnknown || *engineVariant) return engineVariant; return variantNames[v]; } @@ -10003,7 +10003,7 @@ NonStandardBoardSize () { /* [HGM] Awkward testing. Should really be a table */ int overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; - if( gameInfo.variant == VariantUnknown ) return 0; // engine-defined name never needs prefix + if( gameInfo.variant == VariantUnknown || *engineVariant) return 0; // engine-defined name never needs prefix if( gameInfo.variant == VariantXiangqi ) overruled = gameInfo.boardWidth != 9 || gameInfo.boardHeight != 10 || gameInfo.holdingsSize != 0; if( gameInfo.variant == VariantShogi ) diff --git a/dialogs.c b/dialogs.c index da0f4a1..cf7b85a 100644 --- a/dialogs.c +++ b/dialogs.c @@ -468,7 +468,7 @@ static void Pick (int n) { VariantClass v = variantDescriptors[n].value; - if(v == VariantUnknown) safeStrCpy(engineVariant, variantDescriptors[n].name, MSG_SIZ); + if(v == VariantUnknown) safeStrCpy(engineVariant, variantDescriptors[n].name, MSG_SIZ); else *engineVariant = NULLCHAR; if(!appData.noChessProgram) { char *name = VariantName(v), buf[MSG_SIZ]; if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) { diff --git a/winboard/woptions.c b/winboard/woptions.c index b997fd4..a736306 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -874,6 +874,7 @@ VariantWhichRadio(HWND hDlg) if(IsDlgButtonChecked(hDlg, j) && (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1; } + *engineVariant = NULLCHAR; for(i=0; i<9; i++) { // check for engine-defined variants if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) { GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later