]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/itemdef.cpp
Fix some textures not being sent correctly to older clients
[dragonfireclient.git] / src / itemdef.cpp
index 5fb1e4c470019df5a9921977d107da0973c22c6a..d79d6b263f9860f25a1ee06bac12fba07846889f 100644 (file)
@@ -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) {};
 }