From edbc533414b0ba991a82f8003d90924e1dc60d95 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Fri, 15 Sep 2017 12:18:47 +0200 Subject: Customizeable max breath for players (#6411) * Customizeable maximal breath for players --- src/object_properties.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/object_properties.cpp') diff --git a/src/object_properties.cpp b/src/object_properties.cpp index 4171317de..9cbaadc64 100644 --- a/src/object_properties.cpp +++ b/src/object_properties.cpp @@ -34,6 +34,7 @@ std::string ObjectProperties::dump() { std::ostringstream os(std::ios::binary); os << "hp_max=" << hp_max; + os << ", breath_max=" << breath_max; os << ", physical=" << physical; os << ", collideWithObjects=" << collideWithObjects; os << ", weight=" << weight; @@ -108,6 +109,7 @@ void ObjectProperties::serialize(std::ostream &os) const os << serializeString(wield_item); writeU8(os, can_zoom); writeS8(os, glow); + writeU16(os, breath_max); // Add stuff only at the bottom. // Never remove anything, because we don't want new versions of this @@ -155,5 +157,9 @@ void ObjectProperties::deSerialize(std::istream &is) infotext = deSerializeString(is); wield_item = deSerializeString(is); can_zoom = readU8(is); - glow = readS8(is); + + try { + glow = readS8(is); + breath_max = readU16(is); + } catch (SerializationError &e) {} } -- cgit v1.2.3