Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2020-05-07 20:57:13 +01:00
83 changed files with 199 additions and 120 deletions

View File

@@ -948,6 +948,19 @@ static inline bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor = 0
return _sl_version < major || (minor > 0 && _sl_version == major && _sl_minor_version < minor);
}
/**
* Checks whether the savegame is below or at \a major. This should be used to repair data from existing
* savegames which is no longer corrupted in new savegames, but for which otherwise no savegame
* bump is required.
* @param major Major number of the version to check against.
* @return Savegame version is at most the specified version.
*/
static inline bool IsSavegameVersionUntil(SaveLoadVersion major)
{
extern SaveLoadVersion _sl_version;
return _sl_version <= major;
}
/**
* Checks if some version from/to combination falls within the range of the
* active savegame version.