From: numberZero Date: Wed, 12 Apr 2017 14:51:07 +0000 (+0400) Subject: Fix inability to change metadata using stack:to_table() (#5547) X-Git-Tag: 0.4.16~254 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=83508277ce57720ee833bea125388a99cbe4e20d;p=oweals%2Fminetest.git Fix inability to change metadata using stack:to_table() (#5547) --- 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());