summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp14
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();