dont enable mods on update

This commit is contained in:
ConfiG 2023-08-13 14:27:56 +03:00
parent 73169fbf22
commit 6ab542d51a
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
3 changed files with 4 additions and 15 deletions

View file

@ -651,20 +651,8 @@ void Index::Impl::installNext(size_t index, IndexInstallList const& list) {
item->getMetadata().getID(), res.unwrapErr()
));
}
// If the mod is already loaded, enable it
if (mod->isLoaded()) {
res = mod->enable();
if (!res) {
return postError(fmt::format(
"Unable to enable {}: {}",
item->getMetadata().getID(), res.unwrapErr()
));
}
}
}
// Move the temp file
try {
ghc::filesystem::rename(

View file

@ -202,13 +202,13 @@ Mod* Loader::Impl::getInstalledMod(std::string const& id) const {
}
bool Loader::Impl::isModLoaded(std::string const& id) const {
return m_mods.count(id) && m_mods.at(id)->isLoaded() && m_mods.at(id)->isEnabled();
return m_mods.count(id) && m_mods.at(id)->isLoaded();
}
Mod* Loader::Impl::getLoadedMod(std::string const& id) const {
if (m_mods.count(id)) {
auto mod = m_mods.at(id);
if (mod->isLoaded() && mod->isEnabled()) {
if (mod->isLoaded()) {
return mod;
}
}

View file

@ -172,7 +172,8 @@ CCArray* ModListLayer::createModCells(ModListType type, ModListQuery const& quer
// newly installed
for (auto const& item : Index::get()->getItems()) {
if (!item->isInstalled() ||
Loader::get()->isModInstalled(item->getMetadata().getID()))
Loader::get()->isModInstalled(item->getMetadata().getID()) ||
Loader::get()->isModLoaded(item->getMetadata().getID()))
continue;
// match the same as other installed mods
if (auto match = queryMatchKeywords(query, item->getMetadata())) {