TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::AnyAoETargetUnitInObjectRangeCheck Class Reference

#include <GridNotifiers.h>

Public Member Functions

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

Private Attributes

bool i_targetForPlayer
 
WorldObject consti_obj
 
Unit consti_funit
 
SpellInfo const_spellInfo
 
float i_range
 

Constructor & Destructor Documentation

Trinity::AnyAoETargetUnitInObjectRangeCheck::AnyAoETargetUnitInObjectRangeCheck ( WorldObject const obj,
Unit const funit,
float  range 
)
inline
930  : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range)
931  {
932  Unit const* check = i_funit;
933  Unit const* owner = i_funit->GetOwner();
934  if (owner)
935  check = owner;
936  i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER);
937  if (DynamicObject const* dynObj = i_obj->ToDynObject())
938  _spellInfo = sSpellMgr->GetSpellInfo(dynObj->GetSpellId());
939  }
arena_t NULL
Definition: jemalloc_internal.h:624
DynamicObject * ToDynObject()
Definition: Object.h:206
Unit const * i_funit
Definition: GridNotifiers.h:954
Definition: DynamicObject.h:35
TypeID GetTypeId() const
Definition: Object.h:113
SpellInfo const * _spellInfo
Definition: GridNotifiers.h:955
WorldObject const * i_obj
Definition: GridNotifiers.h:953
#define sSpellMgr
Definition: SpellMgr.h:756
bool i_targetForPlayer
Definition: GridNotifiers.h:952
Definition: ObjectGuid.h:33
Unit * GetOwner() const
Definition: Unit.cpp:7542
float i_range
Definition: GridNotifiers.h:956
T check(T value)
Definition: format.h:305
Definition: Unit.h:1305

+ Here is the call graph for this function:

Member Function Documentation

bool Trinity::AnyAoETargetUnitInObjectRangeCheck::operator() ( Unit u)
inline
941  {
942  // Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
943  if (u->GetTypeId() == TYPEID_UNIT && u->IsTotem())
944  return false;
945 
947  return true;
948 
949  return false;
950  }
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=NULL) const
Definition: Unit.cpp:10008
Definition: ObjectGuid.h:32
arena_t NULL
Definition: jemalloc_internal.h:624
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Unit const * i_funit
Definition: GridNotifiers.h:954
TypeID GetTypeId() const
Definition: Object.h:113
SpellInfo const * _spellInfo
Definition: GridNotifiers.h:955
WorldObject const * i_obj
Definition: GridNotifiers.h:953
bool IsTotem() const
Definition: Unit.h:1405
float i_range
Definition: GridNotifiers.h:956
Definition: ObjectGuid.h:35

+ Here is the call graph for this function:

Member Data Documentation

SpellInfo const* Trinity::AnyAoETargetUnitInObjectRangeCheck::_spellInfo
private
Unit const* Trinity::AnyAoETargetUnitInObjectRangeCheck::i_funit
private
WorldObject const* Trinity::AnyAoETargetUnitInObjectRangeCheck::i_obj
private
float Trinity::AnyAoETargetUnitInObjectRangeCheck::i_range
private
bool Trinity::AnyAoETargetUnitInObjectRangeCheck::i_targetForPlayer
private

The documentation for this class was generated from the following file: