summaryrefslogtreecommitdiff
path: root/src/saveload.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload.h')
-rw-r--r--src/saveload.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/saveload.h b/src/saveload.h
index b2f20a548..bed4f7737 100644
--- a/src/saveload.h
+++ b/src/saveload.h
@@ -304,7 +304,7 @@ static inline VarType GetVarFileType(VarType type)
* to add this to the address of the object */
static inline void *GetVariableAddress(const void *object, const SaveLoad *sld)
{
- return (byte*)object + (ptrdiff_t)sld->address;
+ return (byte*)(sld->global ? NULL : object) + (ptrdiff_t)sld->address;
}
int64 ReadValue(const void *ptr, VarType conv);