1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Update and fix doc/mapformat.txt; make current format more solid in mapblock.cpp

This commit is contained in:
Perttu Ahola 2012-06-08 14:57:02 +03:00
parent 22502f80db
commit e74668ef7f
2 changed files with 26 additions and 18 deletions

View file

@ -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())