AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::WorldObjectSpellNearbyTargetCheck Struct Reference

#include "Spell.h"

Inheritance diagram for Acore::WorldObjectSpellNearbyTargetCheck:
Acore::WorldObjectSpellTargetCheck

Public Member Functions

 WorldObjectSpellNearbyTargetCheck (float range, Unit *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
 
bool operator() (WorldObject *target)
 
- Public Member Functions inherited from Acore::WorldObjectSpellTargetCheck
 WorldObjectSpellTargetCheck (Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
 
 ~WorldObjectSpellTargetCheck ()
 
bool operator() (WorldObject *target)
 

Public Attributes

float _range
 
Position const * _position
 
- Public Attributes inherited from Acore::WorldObjectSpellTargetCheck
Unit_caster
 
Unit_referer
 
SpellInfo const * _spellInfo
 
SpellTargetCheckTypes _targetSelectionType
 
ConditionSourceInfo_condSrcInfo
 
ConditionList_condList
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldObjectSpellNearbyTargetCheck()

Acore::WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck ( float  range,
Unit caster,
SpellInfo const *  spellInfo,
SpellTargetCheckTypes  selectionType,
ConditionList condList 
)
9015 : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster)
9016 {
9017 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8934
Position const * _position
Definition: Spell.h:812
float _range
Definition: Spell.h:811

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellNearbyTargetCheck::operator() ( WorldObject target)
9020 {
9021 float dist = target->GetDistance(*_position);
9022 if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target))
9023 {
9024 _range = dist;
9025 return true;
9026 }
9027 return false;
9028 }
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245

References _position, _range, and WorldObject::GetDistance().

Member Data Documentation

◆ _position

Position const* Acore::WorldObjectSpellNearbyTargetCheck::_position

Referenced by operator()().

◆ _range

float Acore::WorldObjectSpellNearbyTargetCheck::_range

Referenced by operator()().