Fix engine-defined variant as startup
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Oct 2014 18:55:00 +0000 (20:55 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 8 Oct 2014 16:38:11 +0000 (18:38 +0200)
Non-standard names were all recognized as 'normal' in InitBackend1().
Now if the -variant argument was not "normal", it is assumed to be an
engine-defined variant if we run with engine.

backend.c

index 315bd8e..faf0b54 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1201,6 +1201,11 @@ InitBackEnd1 ()
        DisplayFatalError(buf, 0, 2);
        return;
 
+      case VariantNormal:     /* definitely works! */
+       if(strcmp(appData.variant, "normal") && appData.chessProgram) { // [HGM] hope this is an engine-defined variant
+         safeStrCpy(engineVariant, appData.variant, MSG_SIZ);
+         return;
+       }
       case VariantXiangqi:    /* [HGM] repetition rules not implemented */
       case VariantFairy:      /* [HGM] TestLegality definitely off! */
       case VariantGothic:     /* [HGM] should work */
@@ -1213,7 +1218,6 @@ InitBackEnd1 ()
       case VariantFalcon:     /* [HGM] untested */
       case VariantCrazyhouse: /* holdings not shown, ([HGM] fixed that!)
                                 offboard interposition not understood */
-      case VariantNormal:     /* definitely works! */
       case VariantWildCastle: /* pieces not automatically shuffled */
       case VariantNoCastle:   /* pieces not automatically shuffled */
       case VariantFischeRandom: /* [HGM] works and shuffles pieces */