aboutsummaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
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) {};
}