mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-01 00:45:26 +02:00
Fix: Crash on startup when mod dependency is not found
This commit is contained in:
committed by
Andrii Danylchenko
parent
4defbc314a
commit
d98f240164
@ -997,10 +997,15 @@ namespace
|
||||
bool testFilePresence(std::string scope, ResourceID resource)
|
||||
{
|
||||
std::set<std::string> allowedScopes;
|
||||
if (scope != "core" && scope != "") // all real mods may have dependencies
|
||||
if(scope != "core" && !scope.empty()) // all real mods may have dependencies
|
||||
{
|
||||
//NOTE: recursive dependencies are not allowed at the moment - update code if this changes
|
||||
allowedScopes = VLC->modh->getModData(scope).dependencies;
|
||||
bool found = true;
|
||||
allowedScopes = VLC->modh->getModDependencies(scope, found);
|
||||
|
||||
if(!found)
|
||||
return false;
|
||||
|
||||
allowedScopes.insert("core"); // all mods can use H3 files
|
||||
}
|
||||
allowedScopes.insert(scope); // mods can use their own files
|
||||
|
Reference in New Issue
Block a user