Allow two-games-per-opening to work with book
[xboard.git] / winboard / wsettings.c
index bfad588..6fc5c40 100644 (file)
@@ -694,6 +694,7 @@ char *tfName;
 int MatchOK()\r
 {\r
     if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1);\r
+    if(!appData.loadGameFile[0]) appData.loadGameIndex = -2*twice; // kludge to pass value of "twice" for use in GUI book\r
     if(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; }\r
     if(CreateTourney(tfName) && !matchMode) { // CreateTourney reloads original settings if file already existed\r
        MatchEvent(2);\r
@@ -771,7 +772,7 @@ void TourneyPopup(HWND hwnd)
     NamesToList(firstChessProgramNames, engineList, engineMnemonic);\r
     comboCallback = &AddToTourney;\r
     autoinc = appData.loadGameIndex < 0 || appData.loadPositionIndex < 0;\r
-    twice = TRUE; swiss = appData.tourneyType < 0;\r
+    twice = FALSE; swiss = appData.tourneyType < 0;\r
     while(engineList[n]) n++; tourneyOptions[3].max = n-1;\r
     snprintf(title, MSG_SIZ, _("Tournament and Match Options"));\r
     ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName));\r