mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix empty legacy meta being persisted
This commit is contained in:
parent
faad6479de
commit
557bbc6704
@ -14,8 +14,9 @@ void ItemStackMetadata::serialize(std::ostream &os) const
|
|||||||
std::ostringstream os2;
|
std::ostringstream os2;
|
||||||
os2 << DESERIALIZE_START;
|
os2 << DESERIALIZE_START;
|
||||||
for (const auto &stringvar : m_stringvars) {
|
for (const auto &stringvar : m_stringvars) {
|
||||||
os2 << stringvar.first << DESERIALIZE_KV_DELIM
|
if (!stringvar.first.empty() || !stringvar.second.empty())
|
||||||
<< stringvar.second << DESERIALIZE_PAIR_DELIM;
|
os2 << stringvar.first << DESERIALIZE_KV_DELIM
|
||||||
|
<< stringvar.second << DESERIALIZE_PAIR_DELIM;
|
||||||
}
|
}
|
||||||
os << serializeJsonStringIfNeeded(os2.str());
|
os << serializeJsonStringIfNeeded(os2.str());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user