summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cChunkMap.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp
index c2c26bae7..515741a62 100644
--- a/source/cChunkMap.cpp
+++ b/source/cChunkMap.cpp
@@ -932,6 +932,21 @@ void cChunkMap::RemoveEntityFromChunk(cEntity * a_Entity, int a_ChunkX, int a_Ch
+bool cChunkMap::ForEachEntityInChunk(int a_ChunkX, int a_ChunkZ, cEntityCallback & a_Callback)
+{
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
+ if ((Chunk == NULL) && !Chunk->IsValid())
+ {
+ return false;
+ }
+ return Chunk->ForEachEntity(a_Callback);
+}
+
+
+
+
+
void cChunkMap::TouchChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
cCSLock Lock(m_CSLayers);