summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-13 07:41:04 +0000
committertron <tron@openttd.org>2004-12-13 07:41:04 +0000
commit1fe087ac4594be1b18cc43838b15863ad38a3966 (patch)
tree9504892d008dd865cb60fb93b6fc51feac3ebc00 /saveload.c
parentc466fcb3b2a8b9882618eb217c24fd2acdbbeca8 (diff)
downloadopenttd-1fe087ac4594be1b18cc43838b15863ad38a3966.tar.xz
(svn r1041) Under certain circumstances obsolete fields are included in the size calculation of a chunk in a savegame which leads to failed loads. This wasn't triggered because the necessary conditions weren't met.
Diffstat (limited to 'saveload.c')
-rw-r--r--saveload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c
index 299890f2c..dda3eefc1 100644
--- a/saveload.c
+++ b/saveload.c
@@ -536,7 +536,8 @@ static size_t SlCalcGlobListLength(const SaveLoadGlobVarList *desc)
size_t length = 0;
while (desc->address) {
- length += SlCalcConvLen(desc->conv, NULL);
+ if(_sl.version >= desc->from_version && _sl.version <= desc->to_version)
+ length += SlCalcConvLen(desc->conv, NULL);
desc++;
}
return length;