X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=pgntags.c;h=9833d1069db16c680eff7ff4b9aa4f79bffd8901;hp=2d9cfb862c266951b89e21004fec32b321b7598f;hb=HEAD;hpb=40269944bc042aced158ae854027ef3a80344fb3 diff --git a/pgntags.c b/pgntags.c index 2d9cfb8..9833d10 100644 --- a/pgntags.c +++ b/pgntags.c @@ -1,7 +1,8 @@ /* * 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, 2016 Free + * Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -114,11 +115,11 @@ 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 = LoadPieceDesc(value); } else if (StrCaseCmp(name, PGN_OUT_OF_BOOK) == 0) { /* [AS] Out of book annotation */ success = StrSavePtr(value, &gameInfo->outOfBook) != NULL;