summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-08-12 22:56:45 +0000
committerDarkvater <darkvater@openttd.org>2006-08-12 22:56:45 +0000
commit00aaf8b8f19a59c9c4b80f9f7e6f98ea489448f6 (patch)
tree777f080b4836af7c585e67cfed624533e20c5e47 /saveload.c
parentdf4f4253daa90582073a56a79088c3398241d2d8 (diff)
downloadopenttd-00aaf8b8f19a59c9c4b80f9f7e6f98ea489448f6.tar.xz
(svn r5871) -Feature: Add a possibility to handle pointer strings without a buffer from the configuration file. Handy for variables that will never be changed during runtime
Diffstat (limited to 'saveload.c')
-rw-r--r--saveload.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c
index 59de6f24a..d1e0cc7db 100644
--- a/saveload.c
+++ b/saveload.c
@@ -510,11 +510,13 @@ static inline size_t SlCalcStringLen(const char *ptr, uint length)
* Save/Load a string.
* @param ptr the string being manipulated
* @param the length of the string (full length)
- * @param conv must be SLE_FILE_STRING */
+ * @param conv must be SLE_FILE_STRING
+ * XXX - only works with global strings of a pre-allocated buffer */
static void SlString(void *ptr, uint length, VarType conv)
{
uint len;
assert(GetVarFileType(conv) == SLE_FILE_STRING);
+ assert(GetVarMemType(conv) == SLE_VAR_STRB || GetVarMemType(conv) == SLE_VAR_STRQ);
if (_sl.save) {
len = SlCalcNetStringLen(ptr, length);