summaryrefslogtreecommitdiff
path: root/src/genericobject.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-04 13:16:09 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-04 13:16:09 +0300
commitb22168d3da597d61c40cc93dd690ba143fd5e4cc (patch)
tree8a0e13767f6761a35c4dd7eaa2f6b38ac6246483 /src/genericobject.cpp
parentb9b56bac6bf5a9701c2898d254a2df9cdf99425c (diff)
downloadminetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.tar.gz
minetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.tar.bz2
minetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.zip
Fix dropped nodeitem visuals
Diffstat (limited to 'src/genericobject.cpp')
-rw-r--r--src/genericobject.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/genericobject.cpp b/src/genericobject.cpp
index 563b7f7f1..1f85d9e47 100644
--- a/src/genericobject.cpp
+++ b/src/genericobject.cpp
@@ -25,43 +25,14 @@ std::string gob_cmd_set_properties(const ObjectProperties &prop)
{
std::ostringstream os(std::ios::binary);
writeU8(os, GENERIC_CMD_SET_PROPERTIES);
- writeS16(os, prop.hp_max);
- writeU8(os, prop.physical);
- writeF1000(os, prop.weight);
- writeV3F1000(os, prop.collisionbox.MinEdge);
- writeV3F1000(os, prop.collisionbox.MaxEdge);
- os<<serializeString(prop.visual);
- writeV2F1000(os, prop.visual_size);
- writeU16(os, prop.textures.size());
- for(u32 i=0; i<prop.textures.size(); i++){
- os<<serializeString(prop.textures[i]);
- }
- writeV2S16(os, prop.spritediv);
- writeV2S16(os, prop.initial_sprite_basepos);
- writeU8(os, prop.is_visible);
- writeU8(os, prop.makes_footstep_sound);
+ prop.serialize(os);
return os.str();
}
ObjectProperties gob_read_set_properties(std::istream &is)
{
ObjectProperties prop;
- prop.hp_max = readS16(is);
- prop.physical = readU8(is);
- prop.weight = readF1000(is);
- prop.collisionbox.MinEdge = readV3F1000(is);
- prop.collisionbox.MaxEdge = readV3F1000(is);
- prop.visual = deSerializeString(is);
- prop.visual_size = readV2F1000(is);
- prop.textures.clear();
- u32 texture_count = readU16(is);
- for(u32 i=0; i<texture_count; i++){
- prop.textures.push_back(deSerializeString(is));
- }
- prop.spritediv = readV2S16(is);
- prop.initial_sprite_basepos = readV2S16(is);
- prop.is_visible = readU8(is);
- prop.makes_footstep_sound = readU8(is);
+ prop.deSerialize(is);
return prop;
}