AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::AnyUnfriendlyUnitInObjectRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

 AnyUnfriendlyUnitInObjectRangeCheck (WorldObject const *obj, Unit const *funit, float range)
 
bool operator() (Unit *u)
 

Private Attributes

WorldObject const * i_obj
 
Unit const * i_funit
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyUnfriendlyUnitInObjectRangeCheck()

Acore::AnyUnfriendlyUnitInObjectRangeCheck::AnyUnfriendlyUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range 
)
inline
860: i_obj(obj), i_funit(funit), i_range(range) {}
Unit const * i_funit
Definition: GridNotifiers.h:871
WorldObject const * i_obj
Definition: GridNotifiers.h:870
float i_range
Definition: GridNotifiers.h:872

Member Function Documentation

◆ operator()()

bool Acore::AnyUnfriendlyUnitInObjectRangeCheck::operator() ( Unit u)
inline
862 {
863 if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u) &&
864 (i_funit->GetTypeId() != TYPEID_UNIT || !i_funit->ToCreature()->IsAvoidingAOE())) // pussywizard
865 return true;
866 else
867 return false;
868 }
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
bool IsAvoidingAOE() const
Definition: Creature.h:124
TypeID GetTypeId() const
Definition: Object.h:121
Creature * ToCreature()
Definition: Object.h:197
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
bool IsAlive() const
Definition: Unit.h:1808
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10202

References Object::GetTypeId(), i_funit, i_obj, i_range, Unit::IsAlive(), Creature::IsAvoidingAOE(), Unit::IsFriendlyTo(), WorldObject::IsWithinDistInMap(), Object::ToCreature(), and TYPEID_UNIT.

Member Data Documentation

◆ i_funit

Unit const* Acore::AnyUnfriendlyUnitInObjectRangeCheck::i_funit
private

Referenced by operator()().

◆ i_obj

WorldObject const* Acore::AnyUnfriendlyUnitInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::AnyUnfriendlyUnitInObjectRangeCheck::i_range
private

Referenced by operator()().