X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pgntags.c;h=b07f977ae01a082775561bf2fe3e19469df41bea;hb=4a93b2d0743219a65784b043395cda77fa80662c;hp=2caed095603db3b46d651ce1d18446b2d7748592;hpb=5bee433e9f42c5194734b2671dbbcfcf9068eab8;p=xboard.git diff --git a/pgntags.c b/pgntags.c index 2caed09..b07f977 100644 --- a/pgntags.c +++ b/pgntags.c @@ -1,7 +1,7 @@ /* * pgntags.c -- Functions to manage PGN tags * - * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -114,8 +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; @@ -161,7 +166,7 @@ PrintPGNTags (FILE *fp, GameInfo *gameInfo) if (gameInfo->variant != VariantNormal) fprintf(fp, "[Variant \"%s\"]\n", VariantName(gameInfo->variant)); if (*(p = CollectPieceDescriptors())) - fprintf(fp, "[Pieces \"%s\"]\n", p); + fprintf(fp, "[VariantMen \"%s\"]\n", p); if (gameInfo->extraTags) fputs(gameInfo->extraTags, fp); }