1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

- improved detection of missing files

Now vcmi will detect situations when file is present in another mod
which is not marked as dependency
This commit is contained in:
Ivan Savenko
2013-12-13 08:53:44 +00:00
parent ed329c5a1f
commit c7899fc14a
3 changed files with 46 additions and 16 deletions

View File

@@ -153,8 +153,7 @@ void CResourceHandler::initialize()
ISimpleResourceLoader * CResourceHandler::get()
{
assert(resourceLoader);
return resourceLoader;
return get("");
}
ISimpleResourceLoader * CResourceHandler::get(std::string identifier)
@@ -175,6 +174,7 @@ void CResourceHandler::load(const std::string &fsConfigURI)
const JsonNode fsConfig((char*)fsConfigData.first.get(), fsConfigData.second);
resourceLoader = new CFilesystemList();
knownLoaders[""] = resourceLoader;
addFilesystem("core", createFileSystem("", fsConfig["filesystem"]));
// hardcoded system-specific path, may not be inside any of data directories
@@ -184,6 +184,7 @@ void CResourceHandler::load(const std::string &fsConfigURI)
void CResourceHandler::addFilesystem(const std::string & identifier, ISimpleResourceLoader * loader)
{
assert(knownLoaders.count(identifier) == 0);
resourceLoader->addLoader(loader, false);
knownLoaders[identifier] = loader;
}