int whiteRating; /* -1 if unknown */
int blackRating; /* -1 if unknown */
VariantClass variant;
+ char *variantName;
char *outOfBook; /* [AS] Move and score when engine went out of book */
int boardWidth; /* [HGM] adjustable board size */
int boardHeight;
gameInfo->whiteRating = -1; /* unknown */
gameInfo->blackRating = -1; /* unknown */
gameInfo->variant = VariantNormal;
+ gameInfo->variantName = NULL;
gameInfo->outOfBook = NULL;
gameInfo->resultDetails = NULL;
}
if (gameInfo->extraTags != NULL) {
free(gameInfo->extraTags);
}
+ if (gameInfo->variantName != NULL) {
+ free(gameInfo->variantName);
+ }
if (gameInfo->outOfBook != NULL) {
free(gameInfo->outOfBook);
}
strncpy( buf, gameInfo->timeControl ? gameInfo->timeControl : "?", MAX_FIELD_LEN );
break;
case GLT_VARIANT:
+ strncpy( buf, gameInfo->variantName ? gameInfo->variantName : VariantName(gameInfo->variant), MAX_FIELD_LEN );
+// strncpy( buf, VariantName(gameInfo->variant), MAX_FIELD_LEN );
break;
case GLT_OUT_OF_BOOK:
strncpy( buf, gameInfo->outOfBook ? gameInfo->outOfBook : "?", MAX_FIELD_LEN );
success = TRUE;
} else if (StrCaseCmp(name, "Variant") == 0) {
/* xboard-defined extension */
+ success = StrSavePtr(value, &gameInfo->variantName) != NULL;
gameInfo->variant = StringToVariant(value);
- success = TRUE;
} else if (StrCaseCmp(name, "VariantMen") == 0) {
/* for now ignore this tag, as we have no method yet */
/* for assigning the pieces to XBoard pictograms */