Core/Housing: stage 39 centralize decor GUID construction

This commit is contained in:
Gexo91
2026-09-12 23:53:54 +03:00
parent 9b30adb426
commit d345f0372d
+9 -4
View File
@@ -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;