mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11466] Use ObjectGuid in Map::m_objectsStore
This commit is contained in:
parent
ef6a48fe03
commit
b8bb108757
7 changed files with 16 additions and 15 deletions
|
|
@ -191,7 +191,7 @@ void Creature::AddToWorld()
|
|||
{
|
||||
///- Register the creature for guid lookup
|
||||
if (!IsInWorld() && GetObjectGuid().IsCreatureOrVehicle())
|
||||
GetMap()->GetObjectsStore().insert<Creature>(GetGUID(), (Creature*)this);
|
||||
GetMap()->GetObjectsStore().insert<Creature>(GetObjectGuid(), (Creature*)this);
|
||||
|
||||
Unit::AddToWorld();
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ void Creature::RemoveFromWorld()
|
|||
{
|
||||
///- Remove the creature from the accessor
|
||||
if (IsInWorld() && GetObjectGuid().IsCreatureOrVehicle())
|
||||
GetMap()->GetObjectsStore().erase<Creature>(GetGUID(), (Creature*)NULL);
|
||||
GetMap()->GetObjectsStore().erase<Creature>(GetObjectGuid(), (Creature*)NULL);
|
||||
|
||||
Unit::RemoveFromWorld();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ void DynamicObject::AddToWorld()
|
|||
{
|
||||
///- Register the dynamicObject for guid lookup
|
||||
if(!IsInWorld())
|
||||
GetMap()->GetObjectsStore().insert<DynamicObject>(GetGUID(), (DynamicObject*)this);
|
||||
GetMap()->GetObjectsStore().insert<DynamicObject>(GetObjectGuid(), (DynamicObject*)this);
|
||||
|
||||
Object::AddToWorld();
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ void DynamicObject::RemoveFromWorld()
|
|||
///- Remove the dynamicObject from the accessor
|
||||
if(IsInWorld())
|
||||
{
|
||||
GetMap()->GetObjectsStore().erase<DynamicObject>(GetGUID(), (DynamicObject*)NULL);
|
||||
GetMap()->GetObjectsStore().erase<DynamicObject>(GetObjectGuid(), (DynamicObject*)NULL);
|
||||
GetViewPoint().Event_RemovedFromWorld();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void GameObject::AddToWorld()
|
|||
{
|
||||
///- Register the gameobject for guid lookup
|
||||
if(!IsInWorld())
|
||||
GetMap()->GetObjectsStore().insert<GameObject>(GetGUID(), (GameObject*)this);
|
||||
GetMap()->GetObjectsStore().insert<GameObject>(GetObjectGuid(), (GameObject*)this);
|
||||
|
||||
Object::AddToWorld();
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ void GameObject::RemoveFromWorld()
|
|||
}
|
||||
}
|
||||
|
||||
GetMap()->GetObjectsStore().erase<GameObject>(GetGUID(), (GameObject*)NULL);
|
||||
GetMap()->GetObjectsStore().erase<GameObject>(GetObjectGuid(), (GameObject*)NULL);
|
||||
}
|
||||
|
||||
Object::RemoveFromWorld();
|
||||
|
|
|
|||
|
|
@ -2902,7 +2902,7 @@ Player* Map::GetPlayer(ObjectGuid guid)
|
|||
*/
|
||||
Creature* Map::GetCreature(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<Creature>(guid.GetRawValue(), (Creature*)NULL);
|
||||
return m_objectsStore.find<Creature>(guid, (Creature*)NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2912,7 +2912,7 @@ Creature* Map::GetCreature(ObjectGuid guid)
|
|||
*/
|
||||
Pet* Map::GetPet(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<Pet>(guid.GetRawValue(), (Pet*)NULL);
|
||||
return m_objectsStore.find<Pet>(guid, (Pet*)NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2953,7 +2953,7 @@ Creature* Map::GetAnyTypeCreature(ObjectGuid guid)
|
|||
*/
|
||||
GameObject* Map::GetGameObject(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<GameObject>(guid.GetRawValue(), (GameObject*)NULL);
|
||||
return m_objectsStore.find<GameObject>(guid, (GameObject*)NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2963,7 +2963,7 @@ GameObject* Map::GetGameObject(ObjectGuid guid)
|
|||
*/
|
||||
DynamicObject* Map::GetDynamicObject(ObjectGuid guid)
|
||||
{
|
||||
return m_objectsStore.find<DynamicObject>(guid.GetRawValue(), (DynamicObject*)NULL);
|
||||
return m_objectsStore.find<DynamicObject>(guid, (DynamicObject*)NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -230,7 +230,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
|
|||
Unit* GetUnit(ObjectGuid guid); // only use if sure that need objects at current map, specially for player case
|
||||
WorldObject* GetWorldObject(ObjectGuid guid); // only use if sure that need objects at current map, specially for player case
|
||||
|
||||
TypeUnorderedMapContainer<AllMapStoredObjectTypes>& GetObjectsStore() { return m_objectsStore; }
|
||||
typedef TypeUnorderedMapContainer<AllMapStoredObjectTypes, ObjectGuid> MapStoredObjectTypesContainer;
|
||||
MapStoredObjectTypesContainer& GetObjectsStore() { return m_objectsStore; }
|
||||
|
||||
void AddUpdateObject(Object *obj)
|
||||
{
|
||||
|
|
@ -304,7 +305,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
|
|||
typedef std::set<WorldObject*> ActiveNonPlayers;
|
||||
ActiveNonPlayers m_activeNonPlayers;
|
||||
ActiveNonPlayers::iterator m_activeNonPlayersIter;
|
||||
TypeUnorderedMapContainer<AllMapStoredObjectTypes> m_objectsStore;
|
||||
MapStoredObjectTypesContainer m_objectsStore;
|
||||
private:
|
||||
time_t i_gridExpiry;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void Pet::AddToWorld()
|
|||
{
|
||||
///- Register the pet for guid lookup
|
||||
if(!IsInWorld())
|
||||
GetMap()->GetObjectsStore().insert<Pet>(GetGUID(), (Pet*)this);
|
||||
GetMap()->GetObjectsStore().insert<Pet>(GetObjectGuid(), (Pet*)this);
|
||||
|
||||
Unit::AddToWorld();
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ void Pet::RemoveFromWorld()
|
|||
{
|
||||
///- Remove the pet from the accessor
|
||||
if(IsInWorld())
|
||||
GetMap()->GetObjectsStore().erase<Pet>(GetGUID(), (Pet*)NULL);
|
||||
GetMap()->GetObjectsStore().erase<Pet>(GetObjectGuid(), (Pet*)NULL);
|
||||
|
||||
///- Don't call the function for Creature, normal mobs + totems go in a different storage
|
||||
Unit::RemoveFromWorld();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11465"
|
||||
#define REVISION_NR "11466"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue