AzerothCore 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
863: i_obj(obj), i_funit(funit), i_range(range) {}
Unit const * i_funit
Definition: GridNotifiers.h:874
WorldObject const * i_obj
Definition: GridNotifiers.h:873
float i_range
Definition: GridNotifiers.h:875

Member Function Documentation

◆ operator()()

bool Acore::AnyUnfriendlyUnitInObjectRangeCheck::operator() ( Unit u)
inline
865 {
866 if (u->IsAlive() && !u->IsCritter() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u) &&
867 (!i_funit->IsCreature() || !i_funit->ToCreature()->IsAvoidingAOE())) // pussywizard
868 return true;
869 else
870 return false;
871 }
bool IsAvoidingAOE() const
Definition: Creature.h:130
bool IsCreature() const
Definition: Object.h:204
Creature * ToCreature()
Definition: Object.h:205
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
bool IsAlive() const
Definition: Unit.h:1654
bool IsCritter() const
Definition: Unit.h:790
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10241

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

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()().