AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
GridNotifiers.cpp File Reference
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "Transport.h"
#include "UpdateData.h"
#include "WorldPacket.h"

Go to the source code of this file.

Functions

void CreatureUnitRelocationWorker (Creature *c, Unit *u)
 

Function Documentation

◆ CreatureUnitRelocationWorker()

void CreatureUnitRelocationWorker ( Creature c,
Unit u 
)
inline
152{
153 if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
154 {
155 return;
156 }
157
159 {
160 if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
161 {
162 c->AI()->MoveInLineOfSight_Safe(u);
163 }
164 else if (u->GetTypeId() == TYPEID_PLAYER && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
165 {
166 c->AI()->TriggerAlert(u);
167 }
168 }
169}
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ UNIT_STATE_SIGHTLESS
Definition: Unit.h:367
void TriggerAlert(Unit const *who) const
Definition: CreatureAI.cpp:175
void MoveInLineOfSight_Safe(Unit *who)
== Reactions At =================================
Definition: CreatureAI.cpp:147
CreatureAI * AI() const
Definition: Creature.h:135
TypeID GetTypeId() const
Definition: Object.h:121
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1726
bool IsAlive() const
Definition: Unit.h:1808
bool HasStealthAura() const
Definition: Unit.h:1706
bool IsInFlight() const
Definition: Unit.h:1676
bool IsAIEnabled
Definition: Unit.h:2350
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398

References Creature::AI(), WorldObject::CanSeeOrDetect(), Object::GetTypeId(), Unit::HasStealthAura(), Unit::HasUnitState(), Unit::IsAIEnabled, Unit::IsAlive(), Unit::IsInFlight(), CreatureAI::MoveInLineOfSight_Safe(), CreatureAI::TriggerAlert(), TYPEID_PLAYER, and UNIT_STATE_SIGHTLESS.

Referenced by Acore::AIRelocationNotifier::Visit(), and Acore::CreatureRelocationNotifier::Visit().