- second part of last commit. This file was accidentally unselected.

This commit is contained in:
Christoph Oelckers 2016-03-08 14:35:36 +01:00
parent 1815b076ee
commit 9d877f75e3

View file

@ -381,13 +381,15 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads)
//
//==========================================================================
static bool havepicked = false;
int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad, const char *zdoom_wad)
{
TArray<WadStuff> wads;
TArray<size_t> 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<FString> &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);