mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix: recursive mod dependencies
Signed-off-by: James Zhou <yunchengzhou@gmail.com>
(cherry picked from commit f181b5d0d7)
This commit is contained in:
parent
22f3343d3f
commit
a100b65978
1 changed files with 4 additions and 6 deletions
|
|
@ -255,7 +255,6 @@ void ModFolderModel::onParseSucceeded(int ticket, QString mod_id)
|
||||||
if (result && resource) {
|
if (result && resource) {
|
||||||
auto* mod = static_cast<Mod*>(resource.get());
|
auto* mod = static_cast<Mod*>(resource.get());
|
||||||
mod->finishResolvingWithDetails(std::move(result->details));
|
mod->finishResolvingWithDetails(std::move(result->details));
|
||||||
|
|
||||||
}
|
}
|
||||||
emit dataChanged(index(row, RequiresColumn), index(row, RequiredByColumn));
|
emit dataChanged(index(row, RequiresColumn), index(row, RequiredByColumn));
|
||||||
}
|
}
|
||||||
|
|
@ -319,15 +318,14 @@ QSet<Mod*> collectMods(QSet<Mod*> mods, QHash<QString, QSet<Mod*>> relation, std
|
||||||
{
|
{
|
||||||
QSet<Mod*> affectedList = {};
|
QSet<Mod*> affectedList = {};
|
||||||
QSet<Mod*> needToCheck = {};
|
QSet<Mod*> needToCheck = {};
|
||||||
for (auto mod : mods) {
|
for (auto* mod : mods) {
|
||||||
auto id = mod->mod_id();
|
auto id = mod->mod_id();
|
||||||
if (seen.count(id) == 0) {
|
if (!seen.contains(id)) {
|
||||||
seen.insert(id);
|
seen.insert(id);
|
||||||
for (auto affected : relation[id]) {
|
for (auto* affected : relation[id]) {
|
||||||
auto affectedId = affected->mod_id();
|
auto affectedId = affected->mod_id();
|
||||||
|
|
||||||
if (findById(mods, affectedId) == nullptr && seen.count(affectedId) == 0) {
|
if (findById(mods, affectedId) == nullptr && !seen.contains(affectedId)) {
|
||||||
seen.insert(affectedId);
|
|
||||||
if (shouldBeEnabled != affected->enabled()) {
|
if (shouldBeEnabled != affected->enabled()) {
|
||||||
affectedList << affected;
|
affectedList << affected;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue