feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)

This commit is contained in:
UltraNix
2021-04-25 22:18:03 +02:00
committed by GitHub
parent 91081f4ad8
commit f4c226423d
568 changed files with 10655 additions and 11019 deletions

View File

@@ -21,7 +21,7 @@ class InstanceScript;
class SummonList
{
public:
typedef std::list<uint64> StorageType;
typedef GuidList StorageType;
typedef StorageType::iterator iterator;
typedef StorageType::const_iterator const_iterator;
typedef StorageType::size_type size_type;
@@ -107,7 +107,7 @@ public:
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
StorageType listCopy = storage_;
acore::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
acore::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); ++i)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
@@ -137,7 +137,7 @@ class EntryCheckPredicate
{
public:
EntryCheckPredicate(uint32 entry) : _entry(entry) {}
bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; }
bool operator()(ObjectGuid guid) { return guid.GetEntry() == _entry; }
private:
uint32 _entry;
@@ -149,7 +149,7 @@ public:
bool operator() (WorldObject* unit) const
{
if (unit->GetTypeId() != TYPEID_PLAYER)
if (!IS_PLAYER_GUID(unit->ToUnit()->GetOwnerGUID()))
if (!unit->ToUnit()->GetOwnerGUID().IsPlayer())
return true;
return false;