diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 68020dcec..1fc63e03d 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -381,13 +381,15 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads) // //========================================================================== +static bool havepicked = false; + int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, const char *zdoom_wad) { TArray wads; TArray foundwads; const char *iwadparm = Args->CheckValue ("-iwad"); - size_t numwads; int pickwad; + size_t numwads; size_t i; bool iwadparmfound = false; FString custwad; @@ -536,26 +538,29 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, { for (i = 0; i < numwads; ++i) { - FString basename = ExtractFileBase (wads[i].Path); - if (stricmp (basename, defaultiwad) == 0) + FString basename = ExtractFileBase(wads[i].Path); + if (stricmp(basename, defaultiwad) == 0) { defiwad = (int)i; break; } } } - pickwad = I_PickIWad (&wads[0], (int)numwads, queryiwad, defiwad); - if (pickwad >= 0) + if (!havepicked) // just use the first IWAD if the restart doesn't have a -iwad parameter. We cannot open the picker in fullscreen mode. { - // The newly selected IWAD becomes the new default - FString basename = ExtractFileBase (wads[pickwad].Path); - defaultiwad = basename; + pickwad = I_PickIWad(&wads[0], (int)numwads, queryiwad, defiwad); + if (pickwad >= 0) + { + // The newly selected IWAD becomes the new default + FString basename = ExtractFileBase(wads[pickwad].Path); + defaultiwad = basename; + } + if (pickwad < 0) + exit(0); + havepicked = true; } } - if (pickwad < 0) - exit (0); - // zdoom.pk3 must always be the first file loaded and the IWAD second. wadfiles.Clear(); D_AddFile (wadfiles, zdoom_wad);