Fix empty legacy meta being persisted

master
rubenwardy 2017-08-19 19:43:02 +01:00 committed by paramat
parent faad6479de
commit 557bbc6704
1 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ 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) {
if (!stringvar.first.empty() || !stringvar.second.empty())
os2 << stringvar.first << DESERIALIZE_KV_DELIM os2 << stringvar.first << DESERIALIZE_KV_DELIM
<< stringvar.second << DESERIALIZE_PAIR_DELIM; << stringvar.second << DESERIALIZE_PAIR_DELIM;
} }