aboutsummaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-12 13:24:36 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-07-23 20:11:53 +0200
commitb7767dd9aae27f0fe6b7ae3b99d0f51860979f82 (patch)
tree0eb7414f1004f9c4d5a77c94df65220325322b5e /src/itemdef.cpp
parent2351c9561265d4136f78ce3dd73c0c77acfed711 (diff)
downloadminetest-b7767dd9aae27f0fe6b7ae3b99d0f51860979f82.tar.xz
Dual Wielding
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index a34805b8e..ca24c6cfa 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -76,6 +76,8 @@ ItemDefinition& ItemDefinition::operator=(const ItemDefinition &def)
groups = def.groups;
node_placement_prediction = def.node_placement_prediction;
place_param2 = def.place_param2;
+ has_on_place = def.has_on_place;
+ has_on_secondary_use = def.has_on_secondary_use;
sound_place = def.sound_place;
sound_place_failed = def.sound_place_failed;
range = def.range;
@@ -120,6 +122,8 @@ void ItemDefinition::reset()
range = -1;
node_placement_prediction = "";
place_param2 = 0;
+ has_on_place = false;
+ has_on_secondary_use = false;
}
void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
@@ -166,6 +170,8 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
os << serializeString16(short_description);
os << place_param2;
+ writeU8(os, has_on_place);
+ writeU8(os, has_on_secondary_use);
}
void ItemDefinition::deSerialize(std::istream &is, u16 protocol_version)
@@ -220,6 +226,8 @@ void ItemDefinition::deSerialize(std::istream &is, u16 protocol_version)
short_description = deSerializeString16(is);
place_param2 = readU8(is); // 0 if missing
+ has_on_place = readU8(is);
+ has_on_secondary_use = readU8(is);
} catch(SerializationError &e) {};
}