diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 9954e896d..d326bce64 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -493,6 +493,7 @@ void FIWadManager::CollectSearchPaths() void FIWadManager::AddIWADCandidates(const char *dir) { FileSys::FileList list; + FString iwadinfoName = "iwadinfo"; if (FileSys::ScanDirectory(list, dir, "*", true)) { @@ -517,6 +518,23 @@ void FIWadManager::AddIWADCandidates(const char *dir) } } } + else + { + FileSys::FileList list; + if (FileSys::ScanDirectory(list, entry.FilePath.c_str(), "*", true)) + { + for (auto& entry2 : list) + { + std::string s = entry2.FileName; + s.resize(std::min(s.size(), iwadinfoName.Len())); + if (iwadinfoName.CompareNoCase(s.c_str()) == 0) + { + mFoundWads.Push(FFoundWadInfo{ entry.FilePath.c_str(), "", -1 }); + break; + } + } + } + } } } } @@ -543,7 +561,12 @@ void FIWadManager::ValidateIWADs() } else { - index = ScanIWAD(p.mFullPath.GetChars()); + bool isdir = false; + bool exists = FileSys::FS_DirEntryExists(p.mFullPath.GetChars(), &isdir); + if (exists && isdir) + index = CheckIWADInfo(p.mFullPath.GetChars()); + else + index = ScanIWAD(p.mFullPath.GetChars()); } p.mInfoIndex = index; }