projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
faad647
)
Fix empty legacy meta being persisted
author
rubenwardy
<rubenwardy@gmail.com>
Sat, 19 Aug 2017 18:43:02 +0000
(19:43 +0100)
committer
paramat
<mat.gregory@virginmedia.com>
Sun, 10 Sep 2017 00:30:42 +0000
(
01:30
+0100)
src/itemstackmetadata.cpp
patch
|
blob
|
history
diff --git
a/src/itemstackmetadata.cpp
b/src/itemstackmetadata.cpp
index 02c548abb6ae88b18519eec027f480381f385f0d..f63671425d390222397a35df81aa0a0dbbe68b10 100644
(file)
--- a/
src/itemstackmetadata.cpp
+++ b/
src/itemstackmetadata.cpp
@@
-14,8
+14,9
@@
void ItemStackMetadata::serialize(std::ostream &os) const
std::ostringstream os2;
os2 << DESERIALIZE_START;
for (const auto &stringvar : m_stringvars) {
- os2 << stringvar.first << DESERIALIZE_KV_DELIM
- << stringvar.second << DESERIALIZE_PAIR_DELIM;
+ if (!stringvar.first.empty() || !stringvar.second.empty())
+ os2 << stringvar.first << DESERIALIZE_KV_DELIM
+ << stringvar.second << DESERIALIZE_PAIR_DELIM;
}
os << serializeJsonStringIfNeeded(os2.str());
}