summaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-10-09 20:11:21 +0200
committerGitHub <noreply@github.com>2020-10-09 19:11:21 +0100
commitf3ae45b2b245dd0aeb4a7d9b76afaf078871104c (patch)
treef9b0e27043bbe8f2b16e6f4917f6b9a92f273345 /src/itemdef.cpp
parentb2f3f663858e6d2a2174066e425bb6f2edea910b (diff)
downloadminetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.tar.gz
minetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.tar.bz2
minetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.zip
Add a short_description to be used by mods (#8980)
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index df20bdf15..5fb1e4c47 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -62,6 +62,7 @@ ItemDefinition& ItemDefinition::operator=(const ItemDefinition &def)
type = def.type;
name = def.name;
description = def.description;
+ short_description = def.short_description;
inventory_image = def.inventory_image;
inventory_overlay = def.inventory_overlay;
wield_image = def.wield_image;
@@ -102,6 +103,7 @@ void ItemDefinition::reset()
type = ITEM_NONE;
name = "";
description = "";
+ short_description = "";
inventory_image = "";
inventory_overlay = "";
wield_image = "";
@@ -162,6 +164,8 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
writeARGB8(os, color);
os << serializeString16(inventory_overlay);
os << serializeString16(wield_overlay);
+
+ os << serializeString16(short_description);
}
void ItemDefinition::deSerialize(std::istream &is)
@@ -213,8 +217,9 @@ void ItemDefinition::deSerialize(std::istream &is)
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
- //try {
- //} catch(SerializationError &e) {};
+ try {
+ short_description = deSerializeString16(is);
+ } catch(SerializationError &e) {};
}