diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:45:26 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:45:26 +0100 |
commit | 2928cb6853f1e007e98f174c37d75c793a0c09cc (patch) | |
tree | 25865a247f5460f185f7f058e0db54637b487a5d /source/cChunkMap.cpp | |
parent | Got rid of dangerous GetEntity(), not using DoWithEntity() (diff) | |
download | cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.gz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.bz2 cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.lz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.xz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.zst cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.zip |
Diffstat (limited to 'source/cChunkMap.cpp')
-rw-r--r-- | source/cChunkMap.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index 7b249dcae..dbe6607fc 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -276,6 +276,17 @@ bool cChunkMap::IsChunkValid(int a_ChunkX, int a_ChunkY, int a_ChunkZ) +bool cChunkMap::HasChunkAnyClients(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
+{
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, a_ChunkY, a_ChunkZ);
+ return (Chunk != NULL) && Chunk->HasAnyClients();
+}
+
+
+
+
+
void cChunkMap::Tick( float a_Dt, MTRand & a_TickRandom )
{
cCSLock Lock(m_CSLayers);
@@ -389,7 +400,6 @@ void cChunkMap::cChunkLayer::Save(void) void cChunkMap::cChunkLayer::UnloadUnusedChunks(void)
{
- cWorld * World = m_Parent->GetWorld();
for (int i = 0; i < ARRAYCOUNT(m_Chunks); i++)
{
if ((m_Chunks[i] != NULL) && (m_Chunks[i]->CanUnload()))
|