summaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-10 12:46:48 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-10 12:46:48 +0300
commit6a0388bb4bedc1b1c6318d7bfebaf1ec67ccf94e (patch)
treed5c31cd32d0a1c73d8eaf9065a7b01235b0fff57 /src/itemdef.cpp
parent7ba72f27630112286456aa5dd4e1738fde58ae6f (diff)
downloadminetest-6a0388bb4bedc1b1c6318d7bfebaf1ec67ccf94e.tar.gz
minetest-6a0388bb4bedc1b1c6318d7bfebaf1ec67ccf94e.tar.bz2
minetest-6a0388bb4bedc1b1c6318d7bfebaf1ec67ccf94e.zip
Node placement client-side prediction
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index fc0942c47..e8de06387 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -70,6 +70,7 @@ ItemDefinition& ItemDefinition::operator=(const ItemDefinition &def)
*def.tool_capabilities);
}
groups = def.groups;
+ node_placement_prediction = def.node_placement_prediction;
#ifndef SERVER
inventory_texture = def.inventory_texture;
if(def.wield_mesh)
@@ -115,6 +116,8 @@ void ItemDefinition::reset()
}
groups.clear();
+ node_placement_prediction = "";
+
#ifndef SERVER
inventory_texture = NULL;
if(wield_mesh)
@@ -150,6 +153,7 @@ void ItemDefinition::serialize(std::ostream &os) const
os<<serializeString(i->first);
writeS16(os, i->second);
}
+ os<<serializeString(node_placement_prediction);
}
void ItemDefinition::deSerialize(std::istream &is)
@@ -184,6 +188,11 @@ void ItemDefinition::deSerialize(std::istream &is)
int value = readS16(is);
groups[name] = value;
}
+ // If you add anything here, insert it primarily inside the try-catch
+ // block to not need to increase the version.
+ try{
+ node_placement_prediction = deSerializeString(is);
+ }catch(SerializationError &e) {};
}
/*