summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-11-21 12:38:16 +0000
committeralberth <alberth@openttd.org>2010-11-21 12:38:16 +0000
commit5f8afaadb7e82b351a26fd5590c6b1e8d148b23b (patch)
treea790a1ed899978e3a9f9ef12f17c17398dc82ffa
parentedef25d30c0cacc4a1d12bfe42e8d956d1363bfb (diff)
downloadopenttd-5f8afaadb7e82b351a26fd5590c6b1e8d148b23b.tar.xz
(svn r21283) -Codechange: Allow minor argument IsSavegameVersionBefore() to be optional.
-rw-r--r--src/saveload/saveload.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index a56a03ba3..8e16f5369 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -448,16 +448,16 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLEG_END() {true, SL_END, 0, 0, 0, 0, NULL}
/**
- * Checks if the savegame is below \a major.\a minor.
+ * Checks whether the savegame is below \a major.\a minor.
* @param major Major number of the version to check against.
- * @param minor Minor number of the version to check against.
- * @return Savegame version is less than the \a major version, or has equal \a major version and a smaller \a minor version.
+ * @param minor Minor number of the version to check against. If \a minor is 0 or not specified, only the major number is checked.
+ * @return Savegame version is earlier than the specified version.
*/
-static inline bool IsSavegameVersionBefore(uint16 major, byte minor)
+static inline bool IsSavegameVersionBefore(uint16 major, byte minor = 0)
{
extern uint16 _sl_version;
extern byte _sl_minor_version;
- return (_sl_version < major) || (_sl_version == major && _sl_minor_version < minor);
+ return _sl_version < major || (minor > 0 && _sl_version == major && _sl_minor_version < minor);
}
/**