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
92: i_unit(unit), isCreature(unit.GetTypeId() == TYPEID_UNIT) {}
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
TypeID GetTypeId() const
Definition: Object.h:121
bool isCreature
Definition: GridNotifiers.h:91
Unit & i_unit
Definition: GridNotifiers.h:90

Member Function Documentation

◆ Visit() [1/2]

void AIRelocationNotifier::Visit ( CreatureMapType m)
199{
200 bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
201 for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
202 {
203 Creature* c = iter->GetSource();
204
205 // 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
208
209 if (self)
211 }
212}
@ NOTIFY_AI_RELOCATION
Definition: Object.h:63
@ NOTIFY_VISIBILITY_CHANGED
Definition: Object.h:64
void CreatureUnitRelocationWorker(Creature *c, Unit *u)
Definition: GridNotifiers.cpp:151
Definition: LinkedList.h:139
Definition: Creature.h:46
bool IsMoveInLineOfSightStrictlyDisabled()
Definition: Creature.h:269
bool isNeedNotify(uint16 f) const
Definition: Object.h:554
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
93{}

Member Data Documentation

◆ i_unit

Unit& Acore::AIRelocationNotifier::i_unit

Referenced by Visit().

◆ isCreature

bool Acore::AIRelocationNotifier::isCreature

Referenced by Visit().