*Fix a crash bug caused by update packet.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-06 19:58:40 -05:00
parent 16d44db8f7
commit db0f2d69b8

View File

@@ -105,7 +105,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
bool UpdateData::BuildPacket(WorldPacket *packet)
{
ByteBuffer buf(m_data.size());
ByteBuffer buf(m_data.size() + 10 + m_outOfRangeGUIDs.size()*8);
buf << (uint32) (!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount);
@@ -128,7 +128,7 @@ bool UpdateData::BuildPacket(WorldPacket *packet)
if (pSize > 100 ) // compress large packets
{
packet->resize(pSize);
packet->resize(pSize * 1.1f + 16);
packet->put<uint32>(0, pSize);