diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 21:12:46 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 21:12:46 +0100 |
| commit | 34c87a0efa18ad77cbf773bc99bd9f08082b27e9 (patch) | |
| tree | ffee1ab1d15463db9113dd4231ba900c296c44f0 /src/profile.cpp | |
| parent | e1106ad42c003f58c06172cb6afef9f526d05d59 (diff) | |
Prevent backups from being enabled.
Diffstat (limited to 'src/profile.cpp')
| -rw-r--r-- | src/profile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<unsigned int> &modsToEnable, const QList<unsigned int> &modsToDisable) +void Profile::setModsEnabled(const QList<unsigned int>& modsToEnable, const QList<unsigned int>& modsToDisable) { QList<unsigned int> dirtyMods; for (auto idx : modsToEnable) { @@ -622,6 +626,9 @@ void Profile::setModsEnabled(const QList<unsigned int> &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); |
