From 34c87a0efa18ad77cbf773bc99bd9f08082b27e9 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 21 Jan 2021 21:12:46 +0100 Subject: Prevent backups from being enabled. --- src/profile.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/profile.cpp') diff --git a/src/profile.cpp b/src/profile.cpp index 6b8d0709..66c23ea1 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -602,11 +602,15 @@ void Profile::setModEnabled(unsigned int index, bool enabled) } ModInfo::Ptr modInfo = ModInfo::getByIndex(index); + // we could quit in the following case, this shouldn't be a change anyway, // but at least this allows the situation to be fixed in case of an error if (modInfo->alwaysEnabled()) { enabled = true; } + if (modInfo->alwaysDisabled()) { + enabled = false; + } if (enabled != m_ModStatus[index].m_Enabled) { m_ModStatus[index].m_Enabled = enabled; @@ -614,7 +618,7 @@ void Profile::setModEnabled(unsigned int index, bool enabled) } } -void Profile::setModsEnabled(const QList &modsToEnable, const QList &modsToDisable) +void Profile::setModsEnabled(const QList& modsToEnable, const QList& modsToDisable) { QList dirtyMods; for (auto idx : modsToEnable) { @@ -622,6 +626,9 @@ void Profile::setModsEnabled(const QList &modsToEnable, const QLis log::error("invalid mod index: {}", idx); continue; } + if (ModInfo::getByIndex(idx)->alwaysDisabled()) { + continue; + } if (!m_ModStatus[idx].m_Enabled) { m_ModStatus[idx].m_Enabled = true; dirtyMods.append(idx); -- cgit v1.3.1