2012-01-29 14:28:19 -05:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
2011-11-06 20:41:54 -05:00
|
|
|
#include "cPacket_Explosion.h"
|
|
|
|
|
2012-01-29 14:28:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-06 20:41:54 -05:00
|
|
|
cPacket_Explosion::~cPacket_Explosion()
|
|
|
|
{
|
|
|
|
if( m_Records )
|
|
|
|
{
|
|
|
|
delete [] m_Records;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-07 15:49:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-06 20:41:54 -05:00
|
|
|
cPacket_Explosion::cPacket_Explosion( const cPacket_Explosion & a_Copy )
|
|
|
|
{
|
2012-02-07 15:49:52 -05:00
|
|
|
m_PacketID = E_EXPLOSION;
|
|
|
|
m_PosX = a_Copy.m_PosX;
|
|
|
|
m_PosY = a_Copy.m_PosY;
|
|
|
|
m_PosZ = a_Copy.m_PosZ;
|
|
|
|
m_Radius = a_Copy.m_Radius; //might not be radius
|
|
|
|
m_RecordsCount= a_Copy.m_RecordsCount;
|
|
|
|
|
|
|
|
m_Records = new char[(m_RecordsCount * 3)];
|
|
|
|
memcpy( m_Records, a_Copy.m_Records, (m_RecordsCount * 3) );
|
2011-11-06 20:41:54 -05:00
|
|
|
}
|
|
|
|
|
2012-02-07 15:49:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cPacket_Explosion::Serialize(AString & a_Data) const
|
2011-11-06 20:41:54 -05:00
|
|
|
{
|
2012-02-07 15:49:52 -05:00
|
|
|
AppendByte (a_Data, m_PacketID);
|
|
|
|
AppendDouble (a_Data, m_PosX);
|
|
|
|
AppendDouble (a_Data, m_PosY);
|
|
|
|
AppendDouble (a_Data, m_PosZ);
|
|
|
|
AppendFloat (a_Data, m_Radius);
|
|
|
|
AppendInteger(a_Data, m_RecordsCount);
|
|
|
|
AppendData (a_Data, m_Records, (m_RecordsCount * 3));
|
2011-11-06 20:41:54 -05:00
|
|
|
}
|
2012-02-07 15:49:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|