From 1a37d04c539f7b8d702c9ea76009ee196969ca38 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 16 Oct 2014 20:29:27 +0200 Subject: [PATCH] Preserve parent variant for PGN of engine-defined game Rather than decoding an unknown variant name, (which will result in 'normal'), we keep the currently set (parent) variant when an engine-defined variant is currently set that matches the name in the PGN variant tag of the loaded game. --- pgntags.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/pgntags.c b/pgntags.c index 616303d..fd74df7 100644 --- a/pgntags.c +++ b/pgntags.c @@ -115,7 +115,8 @@ ParsePGNTag (char *tag, GameInfo *gameInfo) } else if (StrCaseCmp(name, "Variant") == 0) { /* xboard-defined extension */ success = StrSavePtr(value, &gameInfo->variantName) != NULL; - gameInfo->variant = StringToVariant(value); + 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 */ -- 1.7.0.4