]> git.lizzy.rs Git - minetest.git/blobdiff - src/object_properties.cpp
VoxelArea: add_{x,y,z,p} must be static
[minetest.git] / src / object_properties.cpp
index 4171317de0d068388140847f90d7be057a834c9e..e330bc24a0dffb8ac75a7614a8c063aef2c8d32b 100644 (file)
@@ -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;
@@ -64,13 +65,15 @@ std::string ObjectProperties::dump()
                        << "," << nametag_color.getGreen() << "," << nametag_color.getBlue() << "\" ";
        os << ", selectionbox=" << PP(selectionbox.MinEdge) << "," << PP(selectionbox.MaxEdge);
        os << ", pointable=" << pointable;
-       os << ", can_zoom=" << can_zoom;
+       os << ", static_save=" << static_save;
+       os << ", eye_height=" << eye_height;
+       os << ", zoom_fov=" << zoom_fov;
        return os.str();
 }
 
 void ObjectProperties::serialize(std::ostream &os) const
 {
-       writeU8(os, 2); // version, protocol_version >= 36
+       writeU8(os, 3); // version, protocol_version >= 36
        writeS16(os, hp_max);
        writeU8(os, physical);
        writeF1000(os, weight);
@@ -97,7 +100,7 @@ void ObjectProperties::serialize(std::ostream &os) const
                writeARGB8(os, color);
        }
        writeU8(os, collideWithObjects);
-       writeF1000(os,stepheight);
+       writeF1000(os, stepheight);
        writeU8(os, automatic_face_movement_dir);
        writeF1000(os, automatic_face_movement_dir_offset);
        writeU8(os, backface_culling);
@@ -106,8 +109,10 @@ void ObjectProperties::serialize(std::ostream &os) const
        writeF1000(os, automatic_face_movement_max_rotation_per_sec);
        os << serializeString(infotext);
        os << serializeString(wield_item);
-       writeU8(os, can_zoom);
        writeS8(os, glow);
+       writeU16(os, breath_max);
+       writeF1000(os, eye_height);
+       writeF1000(os, zoom_fov);
 
        // Add stuff only at the bottom.
        // Never remove anything, because we don't want new versions of this
@@ -116,7 +121,7 @@ void ObjectProperties::serialize(std::ostream &os) const
 void ObjectProperties::deSerialize(std::istream &is)
 {
        int version = readU8(is);
-       if (version != 2)
+       if (version != 3)
                throw SerializationError("unsupported ObjectProperties version");
 
        hp_max = readS16(is);
@@ -140,6 +145,7 @@ void ObjectProperties::deSerialize(std::istream &is)
        makes_footstep_sound = readU8(is);
        automatic_rotate = readF1000(is);
        mesh = deSerializeString(is);
+       colors.clear();
        u32 color_count = readU16(is);
        for (u32 i = 0; i < color_count; i++){
                colors.push_back(readARGB8(is));
@@ -154,6 +160,8 @@ void ObjectProperties::deSerialize(std::istream &is)
        automatic_face_movement_max_rotation_per_sec = readF1000(is);
        infotext = deSerializeString(is);
        wield_item = deSerializeString(is);
-       can_zoom = readU8(is);
        glow = readS8(is);
+       breath_max = readU16(is);
+       eye_height = readF1000(is);
+       zoom_fov = readF1000(is);
 }