AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::AIRelocationNotifier Struct Reference

#include "GridNotifiers.h"

Public Member Functions

 AIRelocationNotifier (Unit &unit)
 
template<class T >
void Visit (GridRefMgr< T > &)
 
void Visit (CreatureMapType &)
 

Public Attributes

Uniti_unit
 
bool isCreature
 

Detailed Description

Constructor & Destructor Documentation

◆ AIRelocationNotifier()

Acore::AIRelocationNotifier::AIRelocationNotifier ( Unit unit)
inlineexplicit
94: i_unit(unit), isCreature(unit.IsCreature()) {}
bool IsCreature() const
Definition: Object.h:204
bool isCreature
Definition: GridNotifiers.h:93
Unit & i_unit
Definition: GridNotifiers.h:92

Member Function Documentation

◆ Visit() [1/2]

void AIRelocationNotifier::Visit ( CreatureMapType m)
196{
197 bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
198 for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
199 {
200 Creature* c = iter->GetSource();
201
202 // NOTIFY_VISIBILITY_CHANGED | NOTIFY_AI_RELOCATION does not guarantee that unit will do it itself (because distance is also checked), but screw it, it's not that important
205
206 if (self)
208 }
209}
void CreatureUnitRelocationWorker(Creature *c, Unit *u)
Definition: GridNotifiers.cpp:148
@ NOTIFY_AI_RELOCATION
Definition: Object.h:67
@ NOTIFY_VISIBILITY_CHANGED
Definition: Object.h:68
Definition: LinkedList.h:139
Definition: Creature.h:43
bool IsMoveInLineOfSightStrictlyDisabled()
Definition: Creature.h:277
bool isNeedNotify(uint16 f) const
Definition: Object.h:573
iterator begin()
Definition: GridRefMgr.h:35
iterator end()
Definition: GridRefMgr.h:36

References GridRefMgr< OBJECT >::begin(), CreatureUnitRelocationWorker(), GridRefMgr< OBJECT >::end(), i_unit, isCreature, Creature::IsMoveInLineOfSightStrictlyDisabled(), WorldObject::isNeedNotify(), NOTIFY_AI_RELOCATION, and NOTIFY_VISIBILITY_CHANGED.

◆ Visit() [2/2]

template<class T >
void Acore::AIRelocationNotifier::Visit ( GridRefMgr< T > &  )
inline
95{}

Member Data Documentation

◆ i_unit

Unit& Acore::AIRelocationNotifier::i_unit

Referenced by Visit().

◆ isCreature

bool Acore::AIRelocationNotifier::isCreature

Referenced by Visit().