make getLoadedMod and isModLoaded only return if the mod is also enabled

This commit is contained in:
HJfod 2023-02-24 20:52:12 +02:00
parent cb00c2105f
commit 3222097029

View file

@ -252,13 +252,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();
return m_mods.count(id) && m_mods.at(id)->isLoaded() && m_mods.at(id)->isEnabled();
}
Mod* Loader::Impl::getLoadedMod(std::string const& id) const {
if (m_mods.count(id)) {
auto mod = m_mods.at(id);
if (mod->isLoaded()) {
if (mod->isLoaded() && mod->isEnabled()) {
return mod;
}
}