mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8225] Some fixes from 320 branch.
(backported from commit 4bdcf42) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
b7389d2a20
commit
a0efd034ca
10 changed files with 85 additions and 59 deletions
|
|
@ -240,13 +240,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 );
|
||||
}
|
||||
|
||||
|
|
@ -314,7 +314,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2
|
|||
*data << (uint32)((Player*)this)->GetTransTime();
|
||||
*data << (int8)((Player*)this)->GetTransSeat();
|
||||
}
|
||||
//MaNGOS currently not have support for other than player on transport
|
||||
else
|
||||
{
|
||||
//MaNGOS currently not have support for other than player on transport
|
||||
*data << uint8(0);
|
||||
*data << float(0) << float(0) << float(0) << float(0);
|
||||
*data << uint32(0);
|
||||
*data << uint8(-1);
|
||||
}
|
||||
}
|
||||
|
||||
// 0x02200000
|
||||
|
|
@ -803,7 +810,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)
|
||||
{
|
||||
|
|
@ -822,7 +829,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)
|
||||
{
|
||||
|
|
@ -841,7 +848,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);
|
||||
|
|
@ -860,7 +867,7 @@ void Object::SetUInt64Value( 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)
|
||||
{
|
||||
|
|
@ -879,7 +886,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)
|
||||
{
|
||||
|
|
@ -905,7 +912,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)
|
||||
{
|
||||
|
|
@ -979,7 +986,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;
|
||||
|
||||
|
|
@ -1000,7 +1007,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;
|
||||
|
||||
|
|
@ -1021,7 +1028,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)
|
||||
{
|
||||
|
|
@ -1046,7 +1053,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)
|
||||
{
|
||||
|
|
@ -1354,7 +1361,7 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
|
|||
|
||||
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;
|
||||
|
|
@ -1558,7 +1565,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue