Always assume FEN in variant-fairy PGN game is initial position
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 6 Feb 2016 15:19:52 +0000 (16:19 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 6 Feb 2016 15:19:52 +0000 (16:19 +0100)
As variant fairy is a catch-all without a defined initial position,
the FEN tag n a PGN game for this variant must be considered an initial
position. So we copy over the FEN position to the initial one in this
case. Otherwise castling would always be thought illegal in fairy games
loaded from PGN.

backend.c

index b956f94..54c16be 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -13107,7 +13107,7 @@ LoadGame (FILE *f, int gameNumber, char *title, int useList)
            return FALSE;
          }
          CopyBoard(boards[0], initial_position);
            return FALSE;
          }
          CopyBoard(boards[0], initial_position);
-         if(*engineVariant) // [HGM] for now, assume FEN in engine-defined variant game is default initial position
+         if(*engineVariant || gameInfo.variant == VariantFairy) // [HGM] for now, assume FEN in engine-defined variant game is default initial position
            CopyBoard(initialPosition, initial_position);
          if (blackPlaysFirst) {
            currentMove = forwardMostMove = backwardMostMove = 1;
            CopyBoard(initialPosition, initial_position);
          if (blackPlaysFirst) {
            currentMove = forwardMostMove = backwardMostMove = 1;