mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Check argument types inside MetaDataRef Lua API (#7045)
This commit is contained in:
parent
46bbacee95
commit
3f2e0c1206
2 changed files with 7 additions and 7 deletions
|
@ -159,7 +159,7 @@ bool NodeMetaRef::handleFromTable(lua_State *L, int table, Metadata *_meta)
|
|||
lua_pushnil(L);
|
||||
while (lua_next(L, inventorytable) != 0) {
|
||||
// key at index -2 and value at index -1
|
||||
std::string name = lua_tostring(L, -2);
|
||||
std::string name = luaL_checkstring(L, -2);
|
||||
read_inventory_list(L, -1, inv, name.c_str(), getServer(L));
|
||||
lua_pop(L, 1); // Remove value, keep key for next iteration
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue