Revert "Revert "Fix smlua_field_valid for Lua""

This reverts commit e371ff272b.
This commit is contained in:
MysterD 2022-03-22 20:31:07 -07:00
parent 473c318f71
commit cb8bd36698
1 changed files with 2 additions and 2 deletions

View File

@ -337,8 +337,8 @@ static bool smlua_field_valid(struct LuaObjectField* data, enum LuaObjectType lo
size_t length = maximum - minimum;
size_t maxlength = sizeof(void*) + sizeof(u32);
if (length >= maxlength) {
return (data->lot == lot) && (lot != LOT_NONE);
if (length < maxlength) {
return (data->lot == lot) && (data->valueOffset == offset) && (lot != LOT_NONE);
}
return (length >= maxlength);