Revert "Allows loading directories as IWADs using "-iwad" command line parameter."

This reverts commit 81449728d7.

Reverted because it compromises the IWAD file lookup and fixing it properly is not so trivial.
The skipping of adding the file name extension was not only broken, but even after fixing the code does not work if the IWADs are located outside the working directory.
This commit is contained in:
Christoph Oelckers 2016-10-26 12:13:57 +02:00
parent 5309209039
commit 12ce76426e

View file

@ -292,7 +292,6 @@ void FIWadManager::ParseIWadInfos(const char *fn)
int FIWadManager::ScanIWAD (const char *iwad) int FIWadManager::ScanIWAD (const char *iwad)
{ {
FResourceFile *iwadfile = FResourceFile::OpenResourceFile(iwad, NULL, true); FResourceFile *iwadfile = FResourceFile::OpenResourceFile(iwad, NULL, true);
if (iwadfile == NULL) iwadfile = FResourceFile::OpenDirectory(iwad, true); //mxd. A directory can also work as an IWAD
if (iwadfile != NULL) if (iwadfile != NULL)
{ {
@ -345,7 +344,7 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads)
iwad.Format ("%s%s%s", doomwaddir, slash, mIWadNames[i].GetChars()); iwad.Format ("%s%s%s", doomwaddir, slash, mIWadNames[i].GetChars());
FixPathSeperator (iwad); FixPathSeperator (iwad);
if (DirEntryExists(iwad)) if (FileExists (iwad))
{ {
wads[i].Type = ScanIWAD (iwad); wads[i].Type = ScanIWAD (iwad);
if (wads[i].Type != -1) if (wads[i].Type != -1)
@ -414,7 +413,7 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
} }
else else
{ {
if(FileExists(custwad)) DefaultExtension (custwad, ".wad"); //mxd. Don't treat folders as .wads DefaultExtension (custwad, ".wad");
iwadparm = custwad; iwadparm = custwad;
mIWadNames[0] = custwad; mIWadNames[0] = custwad;
CheckIWAD ("", &wads[0]); CheckIWAD ("", &wads[0]);