From 674fe1e955f729e8328772313c45fe76857ec835 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 19 Aug 2012 21:14:45 +0000 Subject: Window, Chest, Furnace and Pawn are not using cPackets at all git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cEntity.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'source/cEntity.cpp') 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; -- cgit v1.2.3