Core/Housing: stage 39 centralize decor GUID construction
This commit is contained in:
@@ -69,12 +69,9 @@ namespace Housing
|
||||
return !guid.IsEmpty() && guid.GetHigh() == HighGuid::Housing && guid.GetSubType() == 1;
|
||||
}
|
||||
|
||||
// Housing subtype 1 has its own GUID layout. ObjectGuid::GetEntry() is for
|
||||
// world-object GUID formats and does not expose the DecorID stored in the
|
||||
// lower 32 bits of the Housing GUID high word.
|
||||
inline uint32 GetDecorId(ObjectGuid const& guid)
|
||||
{
|
||||
return IsDecorGuid(guid) ? uint32(guid.GetRawValue(1) & 0xFFFFFFFFu) : 0;
|
||||
return IsDecorGuid(guid) ? guid.GetEntry() : 0;
|
||||
}
|
||||
|
||||
inline uint32 GetHousingGuidNamespace(ObjectGuid const& guid)
|
||||
@@ -84,6 +81,14 @@ namespace Housing
|
||||
: 0;
|
||||
}
|
||||
|
||||
inline ObjectGuid CreateDecorGuid(uint32 guidNamespace, uint32 decorId, uint64 instanceId)
|
||||
{
|
||||
if (!guidNamespace || !decorId || !instanceId)
|
||||
return ObjectGuid::Empty;
|
||||
|
||||
return ObjectGuid::Create<HighGuid::Housing>(1, guidNamespace & 0xFFFFu, decorId, instanceId);
|
||||
}
|
||||
|
||||
inline bool IsHousingAttachmentGuid(ObjectGuid const& guid)
|
||||
{
|
||||
return guid.IsEmpty() || guid.GetHigh() == HighGuid::Housing || guid.GetHigh() == HighGuid::MeshObject;
|
||||
|
||||
Reference in New Issue
Block a user