char *
VariantName (VariantClass v)
{
- if(v == VariantUnknown) return engineVariant;
+ if(v == VariantUnknown || *engineVariant) return engineVariant;
return variantNames[v];
}
{
/* [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 )
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) {
if(IsDlgButtonChecked(hDlg, j) &&\r
(appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1;\r
}\r
+ *engineVariant = NULLCHAR;\r
for(i=0; i<9; i++) { // check for engine-defined variants\r
if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) {\r
GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later\r