mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix inability to change metadata using stack:to_table() (#5547)
This commit is contained in:
parent
1399678ffd
commit
83508277ce
1 changed files with 2 additions and 0 deletions
|
@ -234,6 +234,8 @@ int LuaItemStack::l_to_table(lua_State *L)
|
||||||
for (StringMap::const_iterator it = fields.begin();
|
for (StringMap::const_iterator it = fields.begin();
|
||||||
it != fields.end(); ++it) {
|
it != fields.end(); ++it) {
|
||||||
const std::string &name = it->first;
|
const std::string &name = it->first;
|
||||||
|
if (name.empty())
|
||||||
|
continue;
|
||||||
const std::string &value = it->second;
|
const std::string &value = it->second;
|
||||||
lua_pushlstring(L, name.c_str(), name.size());
|
lua_pushlstring(L, name.c_str(), name.size());
|
||||||
lua_pushlstring(L, value.c_str(), value.size());
|
lua_pushlstring(L, value.c_str(), value.size());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue