diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 22:54:08 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 22:54:08 +0100 |
commit | eb942797b8a1321f7460cea7763bb6891affd475 (patch) | |
tree | 89d2c6c4724bda06f0d8779a6ab3e02636c968ce /source/cClientHandle.cpp | |
parent | - improved Simulator system (diff) | |
download | cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.gz cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.bz2 cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.lz cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.xz cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.zst cuberite-eb942797b8a1321f7460cea7763bb6891affd475.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cClientHandle.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 4e71c7169..f7b93ca7e 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -375,6 +375,20 @@ void cClientHandle::StreamChunksSmart( cChunk** a_Chunks, unsigned int a_NumChun }
}
+// This removes the client from all chunks. Used when switching worlds
+void cClientHandle::RemoveFromAllChunks()
+{
+ for(int i = 0; i < VIEWDISTANCE*VIEWDISTANCE; i++)
+ {
+ if( m_LoadedChunks[i] )
+ {
+ m_LoadedChunks[i]->RemoveClient( this );
+ m_LoadedChunks[i]->AsyncUnload( this );
+ m_LoadedChunks[i] = 0;
+ }
+ }
+}
+
void cClientHandle::AddPacket(cPacket * a_Packet)
{
m_pState->CriticalSection.Lock();
|