Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "World.h"
|
||||
#include "Transport.h"
|
||||
#include <boost/dynamic_bitset.hpp>
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_model(NULL), m_goValue(), m_AI(NULL), _animKitId(0)
|
||||
@@ -2302,23 +2303,24 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
bool forcedFlags = GetGoType() == GAMEOBJECT_TYPE_CHEST && GetGOInfo()->chest.usegrouplootrules && HasLootRecipient();
|
||||
bool targetIsGM = target->IsGameMaster();
|
||||
|
||||
ByteBuffer fieldBuffer;
|
||||
|
||||
UpdateMask updateMask;
|
||||
updateMask.SetCount(m_valuesCount);
|
||||
boost::dynamic_bitset<uint32> updateMask(m_valuesCount);
|
||||
|
||||
uint32* flags = GameObjectUpdateFieldFlags;
|
||||
uint32 visibleFlag = UF_FLAG_PUBLIC;
|
||||
if (GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER;
|
||||
|
||||
*data << uint8(updateMask.num_blocks());
|
||||
std::size_t maskPos = data->wpos();
|
||||
data->resize(data->size() + updateMask.num_blocks() * sizeof(uint32));
|
||||
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index)
|
||||
{
|
||||
if (_fieldNotifyFlags & flags[index] ||
|
||||
((updateType == UPDATETYPE_VALUES ? _changesMask.GetBit(index) : m_uint32Values[index]) && (flags[index] & visibleFlag)) ||
|
||||
((updateType == UPDATETYPE_VALUES ? _changesMask[index] : m_uint32Values[index]) && (flags[index] & visibleFlag)) ||
|
||||
(index == GAMEOBJECT_FLAGS && forcedFlags))
|
||||
{
|
||||
updateMask.SetBit(index);
|
||||
updateMask.set(index);
|
||||
|
||||
if (index == OBJECT_DYNAMIC_FLAGS)
|
||||
{
|
||||
@@ -2355,8 +2357,8 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
break;
|
||||
}
|
||||
|
||||
fieldBuffer << uint16(dynFlags);
|
||||
fieldBuffer << int16(pathProgress);
|
||||
*data << uint16(dynFlags);
|
||||
*data << int16(pathProgress);
|
||||
}
|
||||
else if (index == GAMEOBJECT_FLAGS)
|
||||
{
|
||||
@@ -2365,14 +2367,14 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
if (GetGOInfo()->chest.usegrouplootrules && !IsLootAllowedFor(target))
|
||||
goFlags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE;
|
||||
|
||||
fieldBuffer << goFlags;
|
||||
*data << goFlags;
|
||||
}
|
||||
else if (index == GAMEOBJECT_LEVEL)
|
||||
{
|
||||
if (isStoppableTransport)
|
||||
fieldBuffer << uint32(m_goValue.Transport.PathProgress);
|
||||
*data << uint32(m_goValue.Transport.PathProgress);
|
||||
else
|
||||
fieldBuffer << m_uint32Values[index];
|
||||
*data << m_uint32Values[index];
|
||||
}
|
||||
else if (index == GAMEOBJECT_BYTES_1)
|
||||
{
|
||||
@@ -2386,16 +2388,14 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
}
|
||||
}
|
||||
|
||||
fieldBuffer << bytes1;
|
||||
*data << bytes1;
|
||||
}
|
||||
else
|
||||
fieldBuffer << m_uint32Values[index]; // other cases
|
||||
*data << m_uint32Values[index]; // other cases
|
||||
}
|
||||
}
|
||||
|
||||
*data << uint8(updateMask.GetBlockCount());
|
||||
updateMask.AppendToPacket(data);
|
||||
data->append(fieldBuffer);
|
||||
boost::to_block_range(updateMask, reinterpret_cast<uint32*>(data->contents() + maskPos));
|
||||
}
|
||||
|
||||
void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* = NULL*/) const
|
||||
|
||||
Reference in New Issue
Block a user