From e421837ba00b7a6cbe9ace477836f067dca58828 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 29 Aug 2020 13:35:58 +0200 Subject: Remove check for alwaysEnabled() and log missing mods in ModList::setActive(). --- src/modlist.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index b093fd88..218604b2 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -952,6 +952,8 @@ bool ModList::setActive(const QString &name, bool active) { unsigned int modIndex = ModInfo::getIndex(name); if (modIndex == UINT_MAX) { + log::debug("Trying to {} mod {} which does not exist.", + active ? "enable" : "disable", name); return false; } else { m_Profile->setModEnabled(modIndex, active); @@ -970,13 +972,11 @@ int ModList::setActive(const QStringList& names, bool active) { for (const auto& name : names) { auto modIndex = ModInfo::getIndex(name); if (modIndex != UINT_MAX) { - - // This check is not done by the bulk Profile::setModsEnabled, so we - // do it here. - ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); - if (!modInfo->alwaysEnabled()) { - indices.append(modIndex); - } + indices.append(modIndex); + } + else { + log::debug("Trying to {} mod {} which does not exist.", + active ? "enable" : "disable", name); } } -- cgit v1.3.1