mirror of
https://github.com/minetest/minetest.git
synced 2024-12-03 04:53:47 +01:00
Fix empty legacy meta being persisted
This commit is contained in:
parent
bb4ef52954
commit
e9087d1be7
@ -13,11 +13,10 @@ void ItemStackMetadata::serialize(std::ostream &os) const
|
|||||||
{
|
{
|
||||||
std::ostringstream os2;
|
std::ostringstream os2;
|
||||||
os2 << DESERIALIZE_START;
|
os2 << DESERIALIZE_START;
|
||||||
for (StringMap::const_iterator
|
for (const auto &stringvar : m_stringvars) {
|
||||||
it = m_stringvars.begin();
|
if (!stringvar.first.empty() || !stringvar.second.empty())
|
||||||
it != m_stringvars.end(); ++it) {
|
os2 << stringvar.first << DESERIALIZE_KV_DELIM
|
||||||
os2 << it->first << DESERIALIZE_KV_DELIM
|
<< stringvar.second << DESERIALIZE_PAIR_DELIM;
|
||||||
<< it->second << DESERIALIZE_PAIR_DELIM;
|
|
||||||
}
|
}
|
||||||
os << serializeJsonStringIfNeeded(os2.str());
|
os << serializeJsonStringIfNeeded(os2.str());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user