summaryrefslogtreecommitdiff
path: root/src/nodemetadata.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2016-09-19 20:06:39 +0200
committersfan5 <sfan5@live.de>2016-09-21 10:29:17 +0200
commit3a57e525009ade2aa039b0bab33e4b10eda36bf4 (patch)
tree477bf35d1819526db19f981330241a692c04cff3 /src/nodemetadata.h
parent5091cb5ecdac39a49bce2317d7054d69ed43f2c1 (diff)
downloadminetest-3a57e525009ade2aa039b0bab33e4b10eda36bf4.tar.gz
minetest-3a57e525009ade2aa039b0bab33e4b10eda36bf4.tar.bz2
minetest-3a57e525009ade2aa039b0bab33e4b10eda36bf4.zip
Do not serialize empty NodeMetadata
This commit fixes #4516, though note that this will gradually fix MapBlocks as they are used/modified and thus re-serialized.
Diffstat (limited to 'src/nodemetadata.h')
-rw-r--r--src/nodemetadata.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nodemetadata.h b/src/nodemetadata.h
index 8d1298212..da1bf595d 100644
--- a/src/nodemetadata.h
+++ b/src/nodemetadata.h
@@ -47,6 +47,7 @@ public:
void deSerialize(std::istream &is);
void clear();
+ bool empty() const;
// Generic key/value store
std::string getString(const std::string &name, unsigned short recursion = 0) const;
@@ -94,6 +95,8 @@ public:
void clear();
private:
+ int countNonEmpty() const;
+
std::map<v3s16, NodeMetadata *> m_data;
};