summaryrefslogtreecommitdiffstats
path: root/source/cEntity.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-26 13:55:42 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-26 13:55:42 +0100
commit7268a70902b04e098b6b530986d9ce6d210fdd07 (patch)
tree4c4a28b6e5fa03a58f3a787505bb02eca200082e /source/cEntity.cpp
parentUsing cSocketThreads for client outgoing packets. Unfortunately had to put in one intermediate thread (cServer::cNotifyWriteThread) to avoid deadlocks. Still, seems we have a proper multithreading for clients and no more per-client threads, yay :) (diff)
downloadcuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar.gz
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar.bz2
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar.lz
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar.xz
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.tar.zst
cuberite-7268a70902b04e098b6b530986d9ce6d210fdd07.zip
Diffstat (limited to 'source/cEntity.cpp')
-rw-r--r--source/cEntity.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/cEntity.cpp b/source/cEntity.cpp
index cb91c2bdc..3df995d59 100644
--- a/source/cEntity.cpp
+++ b/source/cEntity.cpp
@@ -169,14 +169,18 @@ void cEntity::MoveToCorrectChunk(bool a_bIgnoreOldChunk)
void cEntity::Destroy()
{
- if( !m_bDestroyed )
+ if (m_bDestroyed)
{
- m_bDestroyed = true;
- if( !m_bRemovedFromChunk )
- {
- RemoveFromChunk();
- }
+ return;
}
+ if (!m_bRemovedFromChunk)
+ {
+ RemoveFromChunk();
+ }
+
+ m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, cPacket_DestroyEntity(this));
+
+ m_bDestroyed = true;
}