Fix upstream savegame loader not initialising non-upstream settings
See: #367
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
extern SaveLoadVersion _sl_version;
|
||||
extern byte _sl_minor_version;
|
||||
extern const SaveLoadVersion SAVEGAME_VERSION;
|
||||
extern const SaveLoadVersion MAX_LOAD_SAVEGAME_VERSION;
|
||||
|
||||
namespace upstream_sl {
|
||||
|
||||
@@ -742,18 +743,6 @@ static inline bool IsSavegameVersionBeforeOrAt(SaveLoadVersion major)
|
||||
return _sl_version <= major;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if some version from/to combination falls within the range of the
|
||||
* active savegame version.
|
||||
* @param version_from Inclusive savegame version lower bound.
|
||||
* @param version_to Exclusive savegame version upper bound. SL_MAX_VERSION if no upper bound.
|
||||
* @return Active savegame version falls within the given range.
|
||||
*/
|
||||
static inline bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLoadVersion version_to)
|
||||
{
|
||||
return version_from <= SAVEGAME_VERSION && SAVEGAME_VERSION < version_to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NumberType of a setting. This describes the integer type
|
||||
* as it is represented in memory
|
||||
|
@@ -171,7 +171,7 @@ static void LoadSettings(void *object, const SaveLoadCompatTable &slct)
|
||||
for (auto &sd : GetSettingsTableInternal()) {
|
||||
if (sd->flags & SF_NOT_IN_SAVE) continue;
|
||||
if ((sd->flags & SF_NO_NETWORK_SYNC) && _networking && !_network_server) continue;
|
||||
if (!sd->save.ext_feature_test.IsFeaturePresent(SAVEGAME_VERSION, sd->save.version_from, sd->save.version_to)) continue;
|
||||
if (!sd->save.ext_feature_test.IsFeaturePresent(_sl_xv_feature_static_versions, MAX_LOAD_SAVEGAME_VERSION, sd->save.version_from, sd->save.version_to)) continue;
|
||||
|
||||
if (sd->IsIntSetting()) {
|
||||
const IntSettingDesc *int_setting = sd->AsIntSetting();
|
||||
|
Reference in New Issue
Block a user