mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9618] More use ObjectGuid in spell/etc code
This commit is contained in:
parent
21ff192866
commit
b658b25ff8
19 changed files with 117 additions and 122 deletions
|
|
@ -69,14 +69,8 @@ enum HighGuid
|
|||
};
|
||||
|
||||
//*** Must be replaced by ObjectGuid use ***
|
||||
#define IS_CREATURE_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_UNIT )
|
||||
#define IS_PET_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_PET )
|
||||
#define IS_PLAYER_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid!=0 )
|
||||
#define IS_UNIT_GUID(Guid) ( IS_CREATURE_GUID(Guid) || IS_PET_GUID(Guid) || IS_PLAYER_GUID(Guid) )
|
||||
// special case for empty guid need check
|
||||
#define IS_GAMEOBJECT_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_GAMEOBJECT )
|
||||
#define IS_MO_TRANSPORT(Guid) ( GUID_HIPART(Guid) == HIGHGUID_MO_TRANSPORT )
|
||||
|
||||
// l - OBJECT_FIELD_GUID
|
||||
// e - OBJECT_FIELD_ENTRY for GO (except GAMEOBJECT_TYPE_MO_TRANSPORT) and creatures or UNIT_FIELD_PETNUMBER for pets
|
||||
// h - OBJECT_FIELD_GUID + 1
|
||||
|
|
@ -128,6 +122,9 @@ class ObjectGuid
|
|||
ObjectGuid(HighGuid hi, uint32 entry, uint32 counter) : m_guid(uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48)) {}
|
||||
ObjectGuid(HighGuid hi, uint32 counter) : m_guid(uint64(counter) | (uint64(hi) << 48)) {}
|
||||
|
||||
public: // statics
|
||||
static ObjectGuid const EmptyGuid;
|
||||
|
||||
public: // modifiers
|
||||
PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue