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:
parent
c0f0c6568b
commit
fd7a0735c9
15 changed files with 535 additions and 160 deletions
16
src/map.cpp
16
src/map.cpp
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue