fix: correctly handle disabled mods with metadata
im stupid
This commit is contained in:
parent
40ccd1a469
commit
9f1f37e780
@ -53,6 +53,8 @@ void ModFolderLoadTask::run()
|
||||
m_mods_dir.refresh();
|
||||
for (auto entry : m_mods_dir.entryInfoList()) {
|
||||
Mod mod(entry);
|
||||
|
||||
if (mod.enabled()) {
|
||||
if (m_result->mods.contains(mod.internal_id())) {
|
||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::Installed);
|
||||
}
|
||||
@ -61,6 +63,23 @@ void ModFolderLoadTask::run()
|
||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::NoMetadata);
|
||||
}
|
||||
}
|
||||
else {
|
||||
QString chopped_id = mod.internal_id().chopped(9);
|
||||
if (m_result->mods.contains(chopped_id)) {
|
||||
m_result->mods[mod.internal_id()] = mod;
|
||||
|
||||
auto metadata = m_result->mods[chopped_id].metadata();
|
||||
mod.setMetadata(new Metadata::ModStruct(*metadata));
|
||||
|
||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::Installed);
|
||||
m_result->mods.remove(chopped_id);
|
||||
}
|
||||
else {
|
||||
m_result->mods[mod.internal_id()] = mod;
|
||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::NoMetadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit succeeded();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user