mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9575] Use ObjectGuid in Map object stores/world access/search.
This commit is contained in:
parent
b01de55396
commit
a12fecab0d
18 changed files with 131 additions and 126 deletions
|
|
@ -41,11 +41,16 @@ enum TypeMask
|
|||
TYPEMASK_OBJECT = 0x0001,
|
||||
TYPEMASK_ITEM = 0x0002,
|
||||
TYPEMASK_CONTAINER = 0x0006, // TYPEMASK_ITEM | 0x0004
|
||||
TYPEMASK_UNIT = 0x0008,
|
||||
TYPEMASK_UNIT = 0x0008, // players also have it
|
||||
TYPEMASK_PLAYER = 0x0010,
|
||||
TYPEMASK_GAMEOBJECT = 0x0020,
|
||||
TYPEMASK_DYNAMICOBJECT = 0x0040,
|
||||
TYPEMASK_CORPSE = 0x0080
|
||||
TYPEMASK_CORPSE = 0x0080,
|
||||
|
||||
// used combinations in Player::GetObjectByTypeMask (TYPEMASK_UNIT case ignore players in call)
|
||||
TYPEMASK_CREATURE_OR_GAMEOBJECT = TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT,
|
||||
TYPEMASK_CREATURE_GAMEOBJECT_OR_ITEM = TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM,
|
||||
TYPEMASK_CREATURE_GAMEOBJECT_PLAYER_OR_ITEM = TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM | TYPEMASK_PLAYER,
|
||||
};
|
||||
|
||||
enum HighGuid
|
||||
|
|
@ -128,6 +133,7 @@ class ObjectGuid
|
|||
ObjectGuid() : m_guid(0) {}
|
||||
ObjectGuid(uint64 const& guid) : m_guid(guid) {} // NOTE: must be explicit in future for more strict control type conversions
|
||||
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: // modifiers
|
||||
PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue