diff --git a/components/vfs/registerarchives.cpp b/components/vfs/registerarchives.cpp index cd077356f..69d4498bb 100644 --- a/components/vfs/registerarchives.cpp +++ b/components/vfs/registerarchives.cpp @@ -11,13 +11,6 @@ namespace VFS { const Files::PathContainer& dataDirs = collections.getPaths(); - if (useLooseFiles) - for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) - { - // Last data dir has the highest priority - vfs->addArchive(new FileSystemArchive(iter->string())); - } - for (std::vector::const_iterator archive = archives.begin(); archive != archives.end(); ++archive) { if (collections.doesExist(*archive)) @@ -36,6 +29,13 @@ namespace VFS } } + if (useLooseFiles) + for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) + { + // Last data dir has the highest priority + vfs->addArchive(new FileSystemArchive(iter->string())); + } + vfs->buildIndex(); }