diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-19 23:14:45 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-19 23:14:45 +0200 |
commit | 674fe1e955f729e8328772313c45fe76857ec835 (patch) | |
tree | 49511bc948f76825ee1ad6be310034f261b35e90 /source/cEntity.cpp | |
parent | Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle. (diff) | |
download | cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar.gz cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar.bz2 cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar.lz cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar.xz cuberite-674fe1e955f729e8328772313c45fe76857ec835.tar.zst cuberite-674fe1e955f729e8328772313c45fe76857ec835.zip |
Diffstat (limited to 'source/cEntity.cpp')
-rw-r--r-- | source/cEntity.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/source/cEntity.cpp b/source/cEntity.cpp index 3e0ed7190..a906737cf 100644 --- a/source/cEntity.cpp +++ b/source/cEntity.cpp @@ -11,8 +11,6 @@ #include "cReferenceManager.h" #include "cClientHandle.h" -#include "packets/cPacket_DestroyEntity.h" - @@ -115,11 +113,7 @@ void cEntity::MoveToCorrectChunk(bool a_bIgnoreOldChunk) { return; } - if (m_Destroy == NULL) - { - m_Destroy = new cPacket_DestroyEntity(m_Entity); - } - a_Client->Send(*m_Destroy); + a_Client->SendDestroyEntity(*m_Entity); } virtual void Added(cClientHandle * a_Client) override @@ -134,14 +128,12 @@ void cEntity::MoveToCorrectChunk(bool a_bIgnoreOldChunk) } } - cPacket * m_Destroy; cPacket * m_Spawn; bool m_IgnoreOldChunk; cEntity * m_Entity; public: cMover(cEntity * a_Entity, bool a_IgnoreOldChunk) : - m_Destroy(NULL), m_Spawn(NULL), m_IgnoreOldChunk(a_IgnoreOldChunk), m_Entity(a_Entity) @@ -150,7 +142,6 @@ void cEntity::MoveToCorrectChunk(bool a_bIgnoreOldChunk) ~cMover() { delete m_Spawn; - delete m_Destroy; } } Mover(this, a_bIgnoreOldChunk); @@ -177,7 +168,7 @@ void cEntity::Destroy() RemoveFromChunk(); } - m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, cPacket_DestroyEntity(this)); + m_World->BroadcastDestroyEntity(*this); m_bDestroyed = true; |