From 6436c257aca40f3559e9148613f88da892ad60c9 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 22 Apr 2022 23:49:14 -0700 Subject: [PATCH] Allow Lua to set fields to nil --- src/pc/lua/smlua_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index 72d9dcb1..598cfc31 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -103,6 +103,7 @@ LuaFunction smlua_to_lua_function(lua_State* L, int index) { void* smlua_to_cobject(lua_State* L, int index, u16 lot) { s32 indexType = lua_type(L, index); + if (indexType == LUA_TNIL) { return NULL; } if (indexType != LUA_TTABLE) { LOG_LUA_LINE("smlua_to_cobject received improper type '%d'", lua_type(L, index)); gSmLuaConvertSuccess = false;