summaryrefslogtreecommitdiff
path: root/src/saveload/saveload.h
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-29 21:06:35 +0000
committeryexo <yexo@openttd.org>2010-01-29 21:06:35 +0000
commitdc714960e3699144fcd39a13460b0a8f9fd0ca4d (patch)
tree0ee3365a9a70d00ac7ece7d5d12933f8daadc8c1 /src/saveload/saveload.h
parentb0349704b0ae7ffc3f62a38b9e93e0bb65a7b5a4 (diff)
downloadopenttd-dc714960e3699144fcd39a13460b0a8f9fd0ca4d.tar.xz
(svn r18952) -Fix (r18950): loading recent (=newer then title game) savegames failed
Diffstat (limited to 'src/saveload/saveload.h')
-rw-r--r--src/saveload/saveload.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index b5218456c..c3864c04f 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -295,6 +295,16 @@ static inline VarType GetVarFileType(VarType type)
return type & 0xF; // GB(type, 0, 4);
}
+/**
+ * Check if the given saveload type is a numeric type.
+ * @param conv the type to check
+ * @return True if it's a numeric type.
+ */
+static bool IsNumericType(VarType conv)
+{
+ return GetVarMemType(conv) <= SLE_VAR_U64;
+}
+
/** Get the address of the variable. Which one to pick depends on the object
* pointer. If it is NULL we are dealing with global variables so the address
* is taken. If non-null only the offset is stored in the union and we need