Codechange: Make saveload version upper bound exclusive, i.e. version object was removed instead of version object last appeared.

This commit is contained in:
Peter Nelson
2019-01-28 21:54:06 +00:00
committed by PeterN
parent bdf0dc67e9
commit ea4ea62816
22 changed files with 295 additions and 295 deletions

View File

@@ -483,14 +483,14 @@ static inline bool IsSavegameVersionBefore(uint16 major, byte minor = 0)
/**
* Checks if some version from/to combination falls within the range of the
* active savegame version.
* @param version_from Lowest version number that falls within the range.
* @param version_to Highest version number that falls within the range.
* @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(uint16 version_from, uint16 version_to)
{
extern const uint16 SAVEGAME_VERSION;
if (SAVEGAME_VERSION < version_from || SAVEGAME_VERSION > version_to) return false;
if (SAVEGAME_VERSION < version_from || SAVEGAME_VERSION >= version_to) return false;
return true;
}