From 83508277ce57720ee833bea125388a99cbe4e20d Mon Sep 17 00:00:00 2001 From: numberZero Date: Wed, 12 Apr 2017 18:51:07 +0400 Subject: Fix inability to change metadata using stack:to_table() (#5547) --- src/script/lua_api/l_item.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index 19b5b0955..2d32093a7 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -234,6 +234,8 @@ int LuaItemStack::l_to_table(lua_State *L) for (StringMap::const_iterator it = fields.begin(); it != fields.end(); ++it) { const std::string &name = it->first; + if (name.empty()) + continue; const std::string &value = it->second; lua_pushlstring(L, name.c_str(), name.size()); lua_pushlstring(L, value.c_str(), value.size()); -- cgit v1.2.3