Ignore duplicate data directories to work around the fallout of (Fixes #3557)

0.6.3
scrawl 7 years ago
parent 80f7279a4d
commit 047c44f265
No known key found for this signature in database
GPG Key ID: 2E6CC3676024C402

@ -1,5 +1,6 @@
#include "registerarchives.hpp"
#include <set>
#include <iostream>
#include <sstream>
@ -33,12 +34,20 @@ namespace VFS
}
if (useLooseFiles)
{
std::set<boost::filesystem::path> seen;
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
{
std::cout << "Adding data directory " << iter->string() << std::endl;
// Last data dir has the highest priority
vfs->addArchive(new FileSystemArchive(iter->string()));
if (seen.insert(*iter).second)
{
std::cout << "Adding data directory " << iter->string() << std::endl;
// Last data dir has the highest priority
vfs->addArchive(new FileSystemArchive(iter->string()));
}
else
std::cerr << "Ignoring duplicate data directory " << iter->string() << std::endl;
}
}
vfs->buildIndex();
}

Loading…
Cancel
Save