mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- add duplication checking to file list, prevent loading the same file twice unless explicitly asked by the user
This commit is contained in:
parent
590f45441f
commit
28d9fe68ae
1 changed files with 13 additions and 0 deletions
|
@ -216,6 +216,19 @@ void FileSystem::InitMultipleFiles (TArray<FString> &filenames, bool quiet, Lump
|
||||||
DeleteAll();
|
DeleteAll();
|
||||||
numfiles = 0;
|
numfiles = 0;
|
||||||
|
|
||||||
|
// first, check for duplicates
|
||||||
|
if (!Args->CheckParm("-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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(unsigned i=0;i<filenames.Size(); i++)
|
for(unsigned i=0;i<filenames.Size(); i++)
|
||||||
{
|
{
|
||||||
AddFile (filenames[i], nullptr, quiet, filter);
|
AddFile (filenames[i], nullptr, quiet, filter);
|
||||||
|
|
Loading…
Reference in a new issue