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

new object system

This commit is contained in:
Perttu Ahola 2011-04-10 04:15:10 +03:00
parent c0f0c6568b
commit fd7a0735c9
15 changed files with 535 additions and 160 deletions

View file

@ -5239,6 +5239,14 @@ void ServerMap::saveBlock(MapBlock *block)
block->serializeObjects(o, version);
}
/*
Versions up from 15 have static objects.
*/
if(version >= 15)
{
block->m_static_objects.serialize(o);
}
// We just wrote it to the disk
block->resetChangedFlag();
}
@ -5296,6 +5304,14 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto
block->updateObjects(is, version, NULL, 0);
}
/*
Versions up from 15 have static objects.
*/
if(version >= 15)
{
block->m_static_objects.deSerialize(is);
}
if(created_new)
sector->insertBlock(block);