diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -1484,6 +1484,8 @@ size_t SlCalcObjMemberLength(const void return 0; } +#ifdef OTTD_ASSERT + /** * Check whether the variable size of the variable in the saveload configuration * matches with the actual variable size. @@ -1524,9 +1526,13 @@ static bool IsVariableSizeRight(const Sa } } +#endif /* OTTD_ASSERT */ + bool SlObjectMember(void *ptr, const SaveLoad *sld) { +#ifdef OTTD_ASSERT assert(IsVariableSizeRight(sld)); +#endif VarType conv = GB(sld->conv, 0, 8); switch (sld->cmd) {