Skip to content

Commit

Permalink
Don't re-initialise the VFS with the same set of arguments as the cur…
Browse files Browse the repository at this point in the history
…rently active configuration.
  • Loading branch information
codereader committed Dec 5, 2017
1 parent d5ce909 commit 1b9e157
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/vfspk3/Doom3FileSystem.cpp
Expand Up @@ -96,6 +96,13 @@ void Doom3FileSystem::initDirectory(const std::string& inputPath)

void Doom3FileSystem::initialise(const SearchPaths& vfsSearchPaths, const ExtensionSet& allowedExtensions)
{
// Check if the new configuration is any different then the current one
if (!vfsSearchPaths.empty() && vfsSearchPaths == _vfsSearchPaths && allowedExtensions == _allowedExtensions)
{
rMessage() << "VFS::initialise call has identical arguments as current setup, won't do anything." << std::endl;
return;
}

if (!_vfsSearchPaths.empty())
{
// We've been initialised with some paths already, shutdown first
Expand All @@ -106,7 +113,7 @@ void Doom3FileSystem::initialise(const SearchPaths& vfsSearchPaths, const Extens
_allowedExtensions = allowedExtensions;

rMessage() << "Initialising filesystem using " << _vfsSearchPaths.size() << " paths " << std::endl;
rMessage() << "VFS Search Path priority is: " << string::join(_vfsSearchPaths, "\n- ") << std::endl;
rMessage() << "VFS Search Path priority is: \n- " << string::join(_vfsSearchPaths, "\n- ") << std::endl;

rMessage() << "Allowed PK4 Archive File Extensions: " << string::join(_allowedExtensions, ", ") << std::endl;

Expand Down

0 comments on commit 1b9e157

Please sign in to comment.