diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-20 18:16:20 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-20 18:16:20 +0100 |
| commit | 58b6e0eb48b4d4b201613f1062796a9af68fe454 (patch) | |
| tree | c4f4124a146133963be257d871a08245fa2444d7 /src/modinfo.h | |
| parent | 20a87c9cb966e418da055424670b9e661097441d (diff) | |
Increase robustness of mods priority in profile.
Diffstat (limited to 'src/modinfo.h')
| -rw-r--r-- | src/modinfo.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/modinfo.h b/src/modinfo.h index c9b74a66..621a0443 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -103,6 +103,12 @@ public: // Type definitions: MOD_CC }; + // the priority of backups and overwrite from a mod list point of + // view, these do not correspond to the actual priority in the profile + // + static constexpr int BACKUP_PRIORITY = -1; + static constexpr int OVERWRITE_PRIORITY = std::numeric_limits<int>::max(); + public: // Static functions: @@ -602,12 +608,9 @@ public: // Methods after this do not come from IModInterface: */ virtual void ignoreUpdate(bool ignore) = 0; - /** - * @return the fixed priority of mods of this type or INT_MIN if the priority of mods - * needs to be user-modifiable. Can be < 0 to force a priority below user-modifable mods - * or INT_MAX to force priority above all user-modifiables. - */ - virtual int getFixedPriority() const = 0; + // check if this mod has a fixed priority (i.e. that cannot be modified by users) + // + bool isFixedPriority() const { return isBackup() || isOverwrite(); } /** * @return true if the mod is always enabled. |
