TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ObjectGridEvacuator Class Reference

#include <ObjectGridLoader.h>

Public Member Functions

void Visit (CreatureMapType &m)
 
void Visit (GameObjectMapType &m)
 
template<class T >
void Visit (GridRefManager< T > &)
 

Member Function Documentation

void ObjectGridEvacuator::Visit ( CreatureMapType m)
32 {
33  // creature in unloading grid can have respawn point in another grid
34  // if it will be unloaded then it will not respawn in original grid until unload/load original grid
35  // move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
36  for (CreatureMapType::iterator iter = m.begin(); iter != m.end();)
37  {
38  Creature* c = iter->GetSource();
39  ++iter;
40 
41  ASSERT(!c->IsPet() && "ObjectGridRespawnMover must not be called for pets");
42  c->GetMap()->CreatureRespawnRelocation(c, true);
43  }
44 }
Map * GetMap() const
Definition: Object.h:543
bool CreatureRespawnRelocation(Creature *c, bool diffGridOnly)
Definition: Map.cpp:1463
Definition: Creature.h:467
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
bool IsPet() const
Definition: Unit.h:1403
#define ASSERT
Definition: Errors.h:55
iterator end()
Definition: GridRefManager.h:37

+ Here is the call graph for this function:

void ObjectGridEvacuator::Visit ( GameObjectMapType m)
47 {
48  // gameobject in unloading grid can have respawn point in another grid
49  // if it will be unloaded then it will not respawn in original grid until unload/load original grid
50  // move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
51  for (GameObjectMapType::iterator iter = m.begin(); iter != m.end();)
52  {
53  GameObject* go = iter->GetSource();
54  ++iter;
55 
56  go->GetMap()->GameObjectRespawnRelocation(go, true);
57  }
58 }
Map * GetMap() const
Definition: Object.h:543
Definition: LinkedList.h:141
Definition: GameObject.h:880
iterator begin()
Definition: GridRefManager.h:36
iterator end()
Definition: GridRefManager.h:37
bool GameObjectRespawnRelocation(GameObject *go, bool diffGridOnly)
Definition: Map.cpp:1493

+ Here is the call graph for this function:

template<class T >
void ObjectGridEvacuator::Visit ( GridRefManager< T > &  )
inline
72 { }

The documentation for this class was generated from the following files: