aboutsummaryrefslogtreecommitdiff
path: root/src/nodemetadata.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>2020-11-04 16:44:42 +0100
committerGitHub <noreply@github.com>2020-11-04 16:44:42 +0100
commit5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch)
treec980d614fec4a5495798be3e79e033229062c3cd /src/nodemetadata.cpp
parent28f6a79706b088c37268a59d90878220dc4ef9c7 (diff)
parent3af10766fd2b58b068e970266724d7eb10e9316b (diff)
downloaddragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz
Merge branch 'master' into master
Diffstat (limited to 'src/nodemetadata.cpp')
-rw-r--r--src/nodemetadata.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/nodemetadata.cpp b/src/nodemetadata.cpp
index b84ffc8cb..bab7a96af 100644
--- a/src/nodemetadata.cpp
+++ b/src/nodemetadata.cpp
@@ -31,9 +31,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
NodeMetadata
*/
-NodeMetadata::NodeMetadata(IItemDefManager *item_def_mgr):
- m_inventory(new Inventory(item_def_mgr))
-{}
+NodeMetadata::NodeMetadata(IItemDefManager *item_def_mgr) :
+ m_inventory(new Inventory(item_def_mgr))
+{
+}
NodeMetadata::~NodeMetadata()
{
@@ -62,7 +63,7 @@ void NodeMetadata::deSerialize(std::istream &is, u8 version)
{
clear();
int num_vars = readU32(is);
- for(int i=0; i<num_vars; i++){
+ for (int i = 0; i < num_vars; i++) {
std::string name = deSerializeString(is);
std::string var = deSerializeLongString(is);
m_stringvars[name] = var;
@@ -87,7 +88,6 @@ bool NodeMetadata::empty() const
return Metadata::empty() && m_inventory->getLists().empty();
}
-
void NodeMetadata::markPrivate(const std::string &name, bool set)
{
if (set)
@@ -112,8 +112,8 @@ int NodeMetadata::countNonPrivate() const
NodeMetadataList
*/
-void NodeMetadataList::serialize(std::ostream &os, u8 blockver, bool disk,
- bool absolute_pos) const
+void NodeMetadataList::serialize(
+ std::ostream &os, u8 blockver, bool disk, bool absolute_pos) const
{
/*
Version 0 is a placeholder for "nothing to see here; go away."
@@ -129,9 +129,7 @@ void NodeMetadataList::serialize(std::ostream &os, u8 blockver, bool disk,
writeU8(os, version);
writeU16(os, count);
- for (NodeMetadataMap::const_iterator
- i = m_data.begin();
- i != m_data.end(); ++i) {
+ for (NodeMetadataMap::const_iterator i = m_data.begin(); i != m_data.end(); ++i) {
v3s16 p = i->first;
NodeMetadata *data = i->second;
if (data->empty())
@@ -150,8 +148,8 @@ void NodeMetadataList::serialize(std::ostream &os, u8 blockver, bool disk,
}
}
-void NodeMetadataList::deSerialize(std::istream &is,
- IItemDefManager *item_def_mgr, bool absolute_pos)
+void NodeMetadataList::deSerialize(
+ std::istream &is, IItemDefManager *item_def_mgr, bool absolute_pos)
{
clear();
@@ -163,8 +161,8 @@ void NodeMetadataList::deSerialize(std::istream &is,
}
if (version > 2) {
- std::string err_str = std::string(FUNCTION_NAME)
- + ": version " + itos(version) + " not supported";
+ std::string err_str = std::string(FUNCTION_NAME) + ": version " +
+ itos(version) + " not supported";
infostream << err_str << std::endl;
throw SerializationError(err_str);
}
@@ -187,8 +185,8 @@ void NodeMetadataList::deSerialize(std::istream &is,
}
if (m_data.find(p) != m_data.end()) {
warningstream << "NodeMetadataList::deSerialize(): "
- << "already set data at position " << PP(p)
- << ": Ignoring." << std::endl;
+ << "already set data at position " << PP(p)
+ << ": Ignoring." << std::endl;
continue;
}