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