From 58b6e0eb48b4d4b201613f1062796a9af68fe454 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Wed, 20 Jan 2021 18:16:20 +0100 Subject: Increase robustness of mods priority in profile. --- src/modinfo.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/modinfo.h') 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::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. -- cgit v1.3.1