AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MysticBuffetTargetFilter Class Reference

Public Member Functions

 MysticBuffetTargetFilter (Unit *caster)
 
bool operator() (WorldObject *unit) const
 

Private Attributes

Unit_caster
 

Detailed Description

Constructor & Destructor Documentation

◆ MysticBuffetTargetFilter()

MysticBuffetTargetFilter::MysticBuffetTargetFilter ( Unit caster)
inlineexplicit
1102: _caster(caster) { }
Unit * _caster
Definition: boss_sindragosa.cpp:1122

Member Function Documentation

◆ operator()()

bool MysticBuffetTargetFilter::operator() ( WorldObject unit) const
inline
1105 {
1106 if (!unit->IsInMap(_caster))
1107 return true;
1108
1109 // for standard creatures check full LOS
1110 if (Creature* c = unit->ToCreature())
1111 if (!c->IsPet() && c->GetSpawnId())
1112 return !_caster->IsWithinLOSInMap(unit);
1113
1114 // for players and pets check only dynamic los (ice block gameobjects)
1115 float ox, oy, oz;
1116 _caster->GetPosition(ox, oy, oz);
1117 DynamicMapTree const& dTree = unit->GetMap()->GetDynamicMapTree();
1118 return !dTree.isInLineOfSight(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ() + 2.f, ox, oy, oz + 2.f, unit->GetPhaseMask(), VMAP::ModelIgnoreFlags::Nothing);
1119 }
Definition: DynamicTree.h:39
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, VMAP::ModelIgnoreFlags ignoreFlags) const
Definition: DynamicTree.cpp:276
Definition: Creature.h:46
Creature * ToCreature()
Definition: Object.h:202
uint32 GetPhaseMask() const
Definition: Object.h:446
Map * GetMap() const
Definition: Object.h:531
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition: Object.cpp:1347
bool IsInMap(WorldObject const *obj) const
Definition: Object.cpp:1285
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
void GetPosition(float &x, float &y) const
Definition: Position.h:122
float GetPositionY() const
Definition: Position.h:118
DynamicMapTree const & GetDynamicMapTree() const
Definition: Map.h:563

References _caster, Map::GetDynamicMapTree(), WorldObject::GetMap(), WorldObject::GetPhaseMask(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), DynamicMapTree::isInLineOfSight(), WorldObject::IsInMap(), WorldObject::IsWithinLOSInMap(), VMAP::Nothing, and Object::ToCreature().

Member Data Documentation

◆ _caster

Unit* MysticBuffetTargetFilter::_caster
private

Referenced by operator()().