aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-11-25 21:11:45 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 21:11:45 +0200
commitc8acc373c14e1015a9da8ff8e2b6da76857959a8 (patch)
tree37ba2f624f6652d2e9f26ce833df70ddccae964e /src
parent3d1c481f0bdf03b59871237d810685278e87613b (diff)
downloadminetest-c8acc373c14e1015a9da8ff8e2b6da76857959a8.tar.gz
minetest-c8acc373c14e1015a9da8ff8e2b6da76857959a8.tar.bz2
minetest-c8acc373c14e1015a9da8ff8e2b6da76857959a8.zip
Update ContentFeatures serialization format now as PROTOCOL_VERSION was changed
Diffstat (limited to 'src')
-rw-r--r--src/nodedef.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 180219ba8..38c04a59d 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -217,7 +217,7 @@ void ContentFeatures::reset()
void ContentFeatures::serialize(std::ostream &os)
{
- writeU8(os, 5); // version
+ writeU8(os, 6); // version
os<<serializeString(name);
writeU16(os, groups.size());
for(ItemGroupList::const_iterator
@@ -254,6 +254,7 @@ void ContentFeatures::serialize(std::ostream &os)
os<<serializeString(liquid_alternative_flowing);
os<<serializeString(liquid_alternative_source);
writeU8(os, liquid_viscosity);
+ writeU8(os, liquid_renewable);
writeU8(os, light_source);
writeU32(os, damage_per_second);
node_box.serialize(os);
@@ -265,13 +266,12 @@ void ContentFeatures::serialize(std::ostream &os)
serializeSimpleSoundSpec(sound_dug, os);
// Stuff below should be moved to correct place in a version that otherwise changes
// the protocol version
- writeU8(os, liquid_renewable);
}
void ContentFeatures::deSerialize(std::istream &is)
{
int version = readU8(is);
- if(version != 5)
+ if(version != 6)
throw SerializationError("unsupported ContentFeatures version");
name = deSerializeString(is);
groups.clear();
@@ -311,6 +311,7 @@ void ContentFeatures::deSerialize(std::istream &is)
liquid_alternative_flowing = deSerializeString(is);
liquid_alternative_source = deSerializeString(is);
liquid_viscosity = readU8(is);
+ liquid_renewable = readU8(is);
light_source = readU8(is);
damage_per_second = readU32(is);
node_box.deSerialize(is);
@@ -325,7 +326,6 @@ void ContentFeatures::deSerialize(std::istream &is)
try{
// Stuff below should be moved to correct place in a version that
// otherwise changes the protocol version
- liquid_renewable = readU8(is);
}catch(SerializationError &e) {};
}