forked from teamnwah/openmw-tes3coop
Ignore duplicate data directories to work around the fallout of (Fixes #3557)
This commit is contained in:
parent
80f7279a4d
commit
047c44f265
1 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "registerarchives.hpp"
|
#include "registerarchives.hpp"
|
||||||
|
|
||||||
|
#include <set>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
@ -33,12 +34,20 @@ namespace VFS
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useLooseFiles)
|
if (useLooseFiles)
|
||||||
|
{
|
||||||
|
std::set<boost::filesystem::path> seen;
|
||||||
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
|
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
|
||||||
{
|
{
|
||||||
std::cout << "Adding data directory " << iter->string() << std::endl;
|
if (seen.insert(*iter).second)
|
||||||
// Last data dir has the highest priority
|
{
|
||||||
vfs->addArchive(new FileSystemArchive(iter->string()));
|
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();
|
vfs->buildIndex();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue