mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 22:01:41 +00:00
- only check „allowduplicates“ for the final file system init
The other calls to InitMultipleFiles should not use it. Also fix the check to not skip some entries.
This commit is contained in:
parent
18912d1ee9
commit
2bc787b1cc
3 changed files with 9 additions and 5 deletions
|
@ -208,7 +208,7 @@ void FileSystem::InitSingleFile(const char* filename, bool quiet)
|
|||
InitMultipleFiles(filenames, true);
|
||||
}
|
||||
|
||||
void FileSystem::InitMultipleFiles (TArray<FString> &filenames, bool quiet, LumpFilterInfo* filter)
|
||||
void FileSystem::InitMultipleFiles (TArray<FString> &filenames, bool quiet, LumpFilterInfo* filter, bool allowduplicates)
|
||||
{
|
||||
int numfiles;
|
||||
|
||||
|
@ -217,14 +217,17 @@ void FileSystem::InitMultipleFiles (TArray<FString> &filenames, bool quiet, Lump
|
|||
numfiles = 0;
|
||||
|
||||
// first, check for duplicates
|
||||
if (!Args->CheckParm("-allowduplicates"))
|
||||
if (allowduplicates)
|
||||
{
|
||||
for (unsigned i=0;i<filenames.Size(); i++)
|
||||
{
|
||||
for (unsigned j=i+1;j<filenames.Size(); j++)
|
||||
{
|
||||
if (strcmp(filenames[i], filenames[j]) == 0)
|
||||
{
|
||||
filenames.Delete(j);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1697,4 +1700,4 @@ CCMD(fs_dir)
|
|||
bool hidden = fileSystem.FindFile(fn1) != i;
|
||||
Printf(PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10d %s %s\n", hidden ? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
void SetMaxIwadNum(int x) { MaxIwadIndex = x; }
|
||||
|
||||
void InitSingleFile(const char *filename, bool quiet = false);
|
||||
void InitMultipleFiles (TArray<FString> &filenames, bool quiet = false, LumpFilterInfo* filter = nullptr);
|
||||
void InitMultipleFiles (TArray<FString> &filenames, bool quiet = false, LumpFilterInfo* filter = nullptr, bool allowduplicates = false);
|
||||
void AddFile (const char *filename, FileReader *wadinfo, bool quiet, LumpFilterInfo* filter);
|
||||
int CheckIfResourceFileLoaded (const char *name) noexcept;
|
||||
void AddAdditionalFile(const char* filename, FileReader* wadinfo = NULL) {}
|
||||
|
|
|
@ -3205,7 +3205,8 @@ static int D_DoomMain_Internal (void)
|
|||
FindStrifeTeaserVoices(fileSystem);
|
||||
};
|
||||
|
||||
fileSystem.InitMultipleFiles (allwads, false, &lfi);
|
||||
bool allowduplicates = Args->CheckParm("-allowduplicates");
|
||||
fileSystem.InitMultipleFiles (allwads, false, &lfi, allowduplicates);
|
||||
allwads.Clear();
|
||||
allwads.ShrinkToFit();
|
||||
SetMapxxFlag();
|
||||
|
|
Loading…
Reference in a new issue