gtkmacintegration name change
[xboard.git] / pgntags.c
index 2d9cfb8..fd74df7 100644 (file)
--- a/pgntags.c
+++ b/pgntags.c
@@ -114,11 +114,13 @@ ParsePGNTag (char *tag, GameInfo *gameInfo)
        success = TRUE;
     } else if (StrCaseCmp(name, "Variant") == 0) {
         /* xboard-defined extension */
-        gameInfo->variant = StringToVariant(value);
-       success = TRUE;
+       success = StrSavePtr(value, &gameInfo->variantName) != NULL;
+        if(*value && strcmp(value, engineVariant)) // keep current engine-defined variant if it matches
+            gameInfo->variant = StringToVariant(value);
     } else if (StrCaseCmp(name, "VariantMen") == 0) {
         /* for now ignore this tag, as we have no method yet */
         /* for assigning the pieces to XBoard pictograms     */
+        success = TRUE;
     } else if (StrCaseCmp(name, PGN_OUT_OF_BOOK) == 0) {
         /* [AS] Out of book annotation */
         success = StrSavePtr(value, &gameInfo->outOfBook) != NULL;