Core/Entities: Added ObjectGuid class from MaNGOS

This commit is contained in:
Shauren
2014-09-12 23:49:30 +02:00
parent b3f7210f4d
commit 2fc52b5af6
6 changed files with 376 additions and 52 deletions

View File

@@ -82,8 +82,6 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
m_inWorld = false;
m_objectUpdated = false;
m_PackGUID.appendPackGUID(0);
}
WorldObject::~WorldObject()
@@ -140,8 +138,7 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh)
uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh);
SetUInt64Value(OBJECT_FIELD_GUID, guid);
SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType);
m_PackGUID.wpos(0);
m_PackGUID.appendPackGUID(GetGUID());
m_PackGUID.Set(guid);
}
std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const
@@ -336,6 +333,12 @@ uint16 Object::GetUInt16Value(uint16 index, uint8 offset) const
return *(((uint16*)&m_uint32Values[index])+offset);
}
ObjectGuid const& Object::GetGuidValue(uint16 index) const
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, false));
return *((ObjectGuid*)&(m_uint32Values[index]));
}
void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
Unit const* unit = NULL;