diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-22 16:53:40 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-22 16:53:40 +0100 |
commit | 389062a1ed8063d82ddd611f3426c9b2b088e0fc (patch) | |
tree | 50fb81d24e7849bed22b1acf04cad62f9b514450 /source/cChunkMap.cpp | |
parent | Added core.build permission to Core. Without this permission players are unable to build (diff) | |
download | cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar.gz cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar.bz2 cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar.lz cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar.xz cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.tar.zst cuberite-389062a1ed8063d82ddd611f3426c9b2b088e0fc.zip |
Diffstat (limited to 'source/cChunkMap.cpp')
-rw-r--r-- | source/cChunkMap.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index 33441a406..e01899f28 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -747,14 +747,14 @@ void cChunkMap::RemoveChunkClient(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cCli -void cChunkMap::RemoveClientFromChunks(cClientHandle * a_Client, const cChunkCoordsList & a_Chunks)
+void cChunkMap::RemoveClientFromChunks(cClientHandle * a_Client)
{
cCSLock Lock(m_CSLayers);
- for (cChunkCoordsList::const_iterator itr = a_Chunks.begin(); itr != a_Chunks.end(); ++itr)
+ for (cChunkLayerList::const_iterator itr = m_Layers.begin(); itr != m_Layers.end(); ++itr)
{
- GetChunkNoGen(itr->m_ChunkX, itr->m_ChunkY, itr->m_ChunkZ)->RemoveClient(a_Client);
- }
+ (*itr)->RemoveClient(a_Client);
+ } // for itr - m_Layers[]
}
@@ -1006,6 +1006,21 @@ void cChunkMap::cChunkLayer::Tick(float a_Dt, MTRand & a_TickRand) +void cChunkMap::cChunkLayer::RemoveClient(cClientHandle * a_Client)
+{
+ for (int i = 0; i < ARRAYCOUNT(m_Chunks); i++)
+ {
+ if (m_Chunks[i] != NULL)
+ {
+ m_Chunks[i]->RemoveClient(a_Client);
+ }
+ } // for i - m_Chunks[]
+}
+
+
+
+
+
int cChunkMap::cChunkLayer::GetNumChunksLoaded(void) const
{
int NumChunks = 0;
|