Fix inability to change metadata using stack:to_table() (#5547)

master
numberZero 2017-04-12 18:51:07 +04:00 committed by SmallJoker
parent 1399678ffd
commit 83508277ce
1 changed files with 2 additions and 0 deletions

View File

@ -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());