Add setting flag to enable upstream mode load when patx_name set

This commit is contained in:
Jonathan G Rennison
2023-01-14 16:58:49 +00:00
parent 5b490b243d
commit 85fc077637
2 changed files with 2 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ static std::vector<SaveLoad> GetSettingsDesc(bool is_loading)
std::vector<SaveLoad> saveloads; std::vector<SaveLoad> saveloads;
for (auto &sd : GetSettingsTableInternal()) { for (auto &sd : GetSettingsTableInternal()) {
if (sd->flags & SF_NOT_IN_SAVE) continue; if (sd->flags & SF_NOT_IN_SAVE) continue;
if (sd->patx_name != nullptr) continue; if (sd->patx_name != nullptr && !(is_loading && (sd->flags & SF_ENABLE_UPSTREAM_LOAD))) continue;
if (!sd->save.ext_feature_test.IsFeaturePresent(_sl_version, sd->save.version_from, sd->save.version_to)) continue; if (!sd->save.ext_feature_test.IsFeaturePresent(_sl_version, sd->save.version_from, sd->save.version_to)) continue;
VarType new_type = 0; VarType new_type = 0;

View File

@@ -36,6 +36,7 @@ enum SettingFlag : uint32 {
SF_GUI_ADVISE_DEFAULT = 1 << 19, ///< Advise the user to leave this setting at its default value SF_GUI_ADVISE_DEFAULT = 1 << 19, ///< Advise the user to leave this setting at its default value
SF_ENUM_PRE_CB_VALIDATE = 1 << 20, ///< Call the pre_check callback for enum incoming value validation SF_ENUM_PRE_CB_VALIDATE = 1 << 20, ///< Call the pre_check callback for enum incoming value validation
SF_CONVERT_BOOL_TO_INT = 1 << 21, ///< Accept a boolean value when loading an int-type setting from the config file SF_CONVERT_BOOL_TO_INT = 1 << 21, ///< Accept a boolean value when loading an int-type setting from the config file
SF_ENABLE_UPSTREAM_LOAD = 1 << 22, ///< Enable loading from upstream mode savegames even when patx_name is set
}; };
DECLARE_ENUM_AS_BIT_SET(SettingFlag) DECLARE_ENUM_AS_BIT_SET(SettingFlag)