1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Node placement client-side prediction

This commit is contained in:
Perttu Ahola 2012-06-10 12:46:48 +03:00
parent 7ba72f2763
commit 6a0388bb4b
8 changed files with 99 additions and 8 deletions

View file

@ -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) {};
}
/*