1
0

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
This commit is contained in:
madmaxoft@gmail.com
2012-08-19 21:14:45 +00:00
parent 427e582d5f
commit 674fe1e955
17 changed files with 208 additions and 85 deletions

View File

@@ -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;