aboutsummaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
authorMinetest-j45 <55553015+Minetest-j45@users.noreply.github.com>2021-08-30 15:22:40 +0100
committerGitHub <noreply@github.com>2021-08-30 15:22:40 +0100
commit7824a4956bf489b4e2cc35e0c97272eee06be6ba (patch)
tree70243765dc1743a83596f9c6eec122fb417ef92c /src/itemdef.cpp
parent607add326feb44e078b843464ce4a8de09f28743 (diff)
parent35445d24f425c6291a0580b468919ca83de716fd (diff)
downloaddragonfireclient-7824a4956bf489b4e2cc35e0c97272eee06be6ba.tar.xz
Merge pull request #1 from EliasFleckenstein03/master
update
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index 5fb1e4c47..d79d6b263 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -71,13 +71,11 @@ ItemDefinition& ItemDefinition::operator=(const ItemDefinition &def)
stack_max = def.stack_max;
usable = def.usable;
liquids_pointable = def.liquids_pointable;
- if(def.tool_capabilities)
- {
- tool_capabilities = new ToolCapabilities(
- *def.tool_capabilities);
- }
+ if (def.tool_capabilities)
+ tool_capabilities = new ToolCapabilities(*def.tool_capabilities);
groups = def.groups;
node_placement_prediction = def.node_placement_prediction;
+ place_param2 = def.place_param2;
sound_place = def.sound_place;
sound_place_failed = def.sound_place_failed;
range = def.range;
@@ -120,8 +118,8 @@ void ItemDefinition::reset()
sound_place = SimpleSoundSpec();
sound_place_failed = SimpleSoundSpec();
range = -1;
-
node_placement_prediction = "";
+ place_param2 = 0;
}
void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
@@ -166,6 +164,8 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
os << serializeString16(wield_overlay);
os << serializeString16(short_description);
+
+ os << place_param2;
}
void ItemDefinition::deSerialize(std::istream &is)
@@ -219,6 +219,8 @@ void ItemDefinition::deSerialize(std::istream &is)
// block to not need to increase the version.
try {
short_description = deSerializeString16(is);
+
+ place_param2 = readU8(is); // 0 if missing
} catch(SerializationError &e) {};
}