From 456a59e8f77c4da5414c009d3a46a63519f06adf Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 22 Mar 2022 20:31:07 -0700 Subject: [PATCH] Revert "Revert "Fix smlua_field_valid for Lua"" This reverts commit bd5263140a060f8272377206d2b18f526151ec43. --- src/pc/lua/smlua_cobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c index 25620d0b..4b2db6ea 100644 --- a/src/pc/lua/smlua_cobject.c +++ b/src/pc/lua/smlua_cobject.c @@ -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);