[8225] Some fixes from 320 branch. Author: tomrus88

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-30 10:26:15 +08:00
parent 4c9aa14e57
commit 7bd47f8827
9 changed files with 65 additions and 49 deletions

View File

@@ -259,13 +259,13 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
data->AddOutOfRangeGUID(GetGUID());
}
void Object::DestroyForPlayer(Player *target) const
void Object::DestroyForPlayer( Player *target, bool anim ) const
{
ASSERT(target);
WorldPacket data(SMSG_DESTROY_OBJECT, 8);
data << uint64(GetGUID());
data << uint8(0); // WotLK (bool)
data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation
target->GetSession()->SendPacket( &data );
}
@@ -760,7 +760,7 @@ void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const
void Object::SetInt32Value( uint16 index, int32 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_int32Values[ index ] != value)
{
@@ -779,7 +779,7 @@ void Object::SetInt32Value( uint16 index, int32 value )
void Object::SetUInt32Value( uint16 index, uint32 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_uint32Values[ index ] != value)
{
@@ -798,7 +798,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value )
void Object::SetUInt64Value( uint16 index, const uint64 &value )
{
ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index + 1 < m_valuesCount || PrintIndexError( index, true ) );
if(*((uint64*)&(m_uint32Values[ index ])) != value)
{
m_uint32Values[ index ] = *((uint32*)&value);
@@ -859,7 +859,7 @@ bool Object::RemoveUInt64Value(uint16 index, const uint64 &value)
void Object::SetFloatValue( uint16 index, float value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_floatValues[ index ] != value)
{
@@ -878,7 +878,7 @@ void Object::SetFloatValue( uint16 index, float value )
void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@@ -904,7 +904,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 2)
{
@@ -978,7 +978,7 @@ void Object::ApplyModPositiveFloatValue(uint16 index, float val, bool apply)
void Object::SetFlag( uint16 index, uint32 newFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval | newFlag;
@@ -999,7 +999,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag )
void Object::RemoveFlag( uint16 index, uint32 oldFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval & ~oldFlag;
@@ -1020,7 +1020,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@@ -1045,7 +1045,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@@ -1462,7 +1462,7 @@ bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2,
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
{
if(distance==0)
if(distance == 0)
{
rand_x = x;
rand_y = y;
@@ -1696,7 +1696,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
{
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
data << guid;
data << uint64(guid);
SendMessageToSet(&data, true);
}