From 8be77302e9d617f3505d5318d9f349b665ac2fbd Mon Sep 17 00:00:00 2001 From: OgelGames Date: Thu, 25 Apr 2024 02:45:12 +1000 Subject: [PATCH] type check listname --- src/script/lua_api/l_inventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/lua_api/l_inventory.cpp b/src/script/lua_api/l_inventory.cpp index 3a189fee7d..e7244618cc 100644 --- a/src/script/lua_api/l_inventory.cpp +++ b/src/script/lua_api/l_inventory.cpp @@ -272,7 +272,7 @@ int InvRef::l_set_lists(lua_State *L) lua_pushnil(L); luaL_checktype(L, 2, LUA_TTABLE); while (lua_next(L, 2)) { - const char *listname = lua_tostring(L, -2); + const char *listname = luaL_checkstring(L, -2); read_inventory_list(L, -1, &tempInv, listname, server); lua_pop(L, 1); }