mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
Enable dependencies first before enabling newly downloaded mod
Also handles the case when mod dependency is scheduled to be enabled only after dependent mod
This commit is contained in:
parent
476beb5145
commit
79ce3c7a0e
@ -876,6 +876,13 @@ void CModListView::installMods(QStringList archives)
|
||||
auto mod = modModel->getMod(modName);
|
||||
if(mod.isInstalled() && !mod.getValue("keepDisabled").toBool())
|
||||
{
|
||||
for (auto const & dependencyName : mod.getDependencies())
|
||||
{
|
||||
auto dependency = modModel->getMod(dependencyName);
|
||||
if(dependency.isDisabled())
|
||||
manager->enableMod(dependencyName);
|
||||
}
|
||||
|
||||
if(mod.isDisabled() && manager->enableMod(modName))
|
||||
{
|
||||
for(QString child : modModel->getChildren(modName))
|
||||
|
Loading…
x
Reference in New Issue
Block a user