From d7d60bf61b5fd21577c9b518dcb52809f2fb27ec Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 10 Dec 2024 13:59:29 +0000 Subject: [PATCH] Fix installing mods from outside of mod view only installing mod dependencies, and not actual requested mod --- launcher/modManager/cmodlistview_moc.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index b162a481e..433a93fa7 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -620,14 +620,7 @@ void CModListView::on_installButton_clicked() { QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString(); - for(const auto & name : getModsToInstall(modName)) - { - auto mod = modStateModel->getMod(name); - if(mod.isAvailable()) - downloadMod(mod); - else if(!modStateModel->isModEnabled(name)) - enableModByName(name); - } + doInstallMod(modName); ui->installButton->setEnabled(false); } @@ -969,11 +962,13 @@ void CModListView::on_screenshotsList_clicked(const QModelIndex & index) void CModListView::doInstallMod(const QString & modName) { - for(const auto & name : modStateModel->getMod(modName).getDependencies()) + for(const auto & name : getModsToInstall(modName)) { auto mod = modStateModel->getMod(name); - if(!mod.isInstalled()) + if(mod.isAvailable()) downloadMod(mod); + else if(!modStateModel->isModEnabled(name)) + enableModByName(name); } }