summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-16 10:35:07 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-16 10:35:07 +0200
commitada984facf47465b7a081eaf75d5541110c12f60 (patch)
treeebf09e32018e76a20df35e49965e15f8235cd6e2 /source/cChunkMap.cpp
parentLua binding for cVine fixed (diff)
downloadcuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.gz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.bz2
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.lz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.xz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.zst
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.zip
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);