Fix pasting of moves after starting from position file
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 27 Jan 2016 19:14:07 +0000 (20:14 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 27 Jan 2016 19:14:07 +0000 (20:14 +0100)
When starting from a position file boards[0] would be set to the position,
but initialPosition was not. In LoadGame() initialPosition would then be
copied to boards[0] before loading the game, and without FEN or variant
PGN tag would not be corrected.

backend.c

index 29e5297..35b8a28 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1740,6 +1740,7 @@ InitBackEnd3 P((void))
             if(!blackPlaysFirst) {
                 startedFromPositionFile = TRUE;
                 CopyBoard(filePosition, boards[0]);
+                CopyBoard(initialPosition, boards[0]);
             }
        }
        if (initialMode == AnalyzeMode) {
@@ -12989,7 +12990,7 @@ LoadGame (FILE *f, int gameNumber, char *title, int useList)
        gameInfo.event = StrSave(yy_text);
     }
 
-    startedFromSetupPosition = FALSE;
+    startedFromSetupPosition = startedFromPositionFile; // [HGM]
     while (cm == PGNTag) {
        if (appData.debugMode)
          fprintf(debugFP, "Parsed PGNTag: %s\n", yy_text);