aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 43502253b..7439076d3 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1510,6 +1510,11 @@ void Map::timerUpdate(float dtime, float unload_timeout,
}
}
+void Map::unloadUnreferencedBlocks(std::list<v3s16> *unloaded_blocks)
+{
+ timerUpdate(0.0, -1.0, unloaded_blocks);
+}
+
void Map::deleteSectors(std::list<v2s16> &list)
{
for(std::list<v2s16>::iterator j = list.begin();
@@ -3409,6 +3414,26 @@ void ServerMap::listAllLoadableBlocks(std::list<v3s16> &dst)
}
}
+void ServerMap::listAllLoadedBlocks(std::list<v3s16> &dst)
+{
+ for(std::map<v2s16, MapSector*>::iterator si = m_sectors.begin();
+ si != m_sectors.end(); ++si)
+ {
+ MapSector *sector = si->second;
+
+ std::list<MapBlock*> blocks;
+ sector->getBlocks(blocks);
+
+ for(std::list<MapBlock*>::iterator i = blocks.begin();
+ i != blocks.end(); ++i)
+ {
+ MapBlock *block = (*i);
+ v3s16 p = block->getPos();
+ dst.push_back(p);
+ }
+ }
+}
+
void ServerMap::saveMapMeta()
{
DSTACK(__FUNCTION_NAME);