summaryrefslogtreecommitdiff
path: root/src/mapblock.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-08 14:57:02 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-08 14:57:02 +0300
commite74668ef7f68156ef9c24ecc97d130ca53f8c624 (patch)
tree37531521aaba4122e4a89af98466ce1451117154 /src/mapblock.cpp
parent22502f80db7236680e2ce18ee8a4fc59f4c9c8e7 (diff)
downloadminetest-e74668ef7f68156ef9c24ecc97d130ca53f8c624.tar.gz
minetest-e74668ef7f68156ef9c24ecc97d130ca53f8c624.tar.bz2
minetest-e74668ef7f68156ef9c24ecc97d130ca53f8c624.zip
Update and fix doc/mapformat.txt; make current format more solid in mapblock.cpp
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r--src/mapblock.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index 70a0f6ed0..c4d3c422e 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -616,9 +616,13 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
*/
if(disk)
{
- // Node timers
- if(version >= 23)
- m_node_timers.serialize(os);
+ // Version 23 doesn't actually contain node timers
+ // (this field should have not been added)
+ if(version == 23)
+ writeU8(os, 0);
+ // Node timers (uncomment when node timers are taken into use)
+ /*if(version >= 24)
+ m_node_timers.serialize(os);*/
// Static objects
m_static_objects.serialize(os);
@@ -698,11 +702,15 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
if(disk)
{
// Node timers
- if(version >= 23){
+ if(version == 23)
+ // Read unused zero
+ readU8(is);
+ // Uncomment when node timers are taken into use
+ /*else if(version >= 24){
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Node timers"<<std::endl);
m_node_timers.deSerialize(is);
- }
+ }*/
// Static objects
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())