AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::AnyAssistCreatureInRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

 AnyAssistCreatureInRangeCheck (Unit *funit, Unit *enemy, float range)
 
bool operator() (Creature *u)
 

Private Attributes

Unit *const i_funit
 
Unit *const i_enemy
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyAssistCreatureInRangeCheck()

Acore::AnyAssistCreatureInRangeCheck::AnyAssistCreatureInRangeCheck ( Unit funit,
Unit enemy,
float  range 
)
inline
1269 : i_funit(funit), i_enemy(enemy), i_range(range)
1270 {
1271 }
Unit *const i_enemy
Definition: GridNotifiers.h:1292
float i_range
Definition: GridNotifiers.h:1293
Unit *const i_funit
Definition: GridNotifiers.h:1291

Member Function Documentation

◆ operator()()

bool Acore::AnyAssistCreatureInRangeCheck::operator() ( Creature u)
inline
1273 {
1274 if (u == i_funit)
1275 return false;
1276
1277 if (!u->CanAssistTo(i_funit, i_enemy))
1278 return false;
1279
1280 // too far
1282 return false;
1283
1284 // only if see assisted creature
1285 if (!i_funit->IsWithinLOSInMap(u))
1286 return false;
1287
1288 return true;
1289 }
bool CanAssistTo(Unit const *u, Unit const *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2489
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 IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321

References Creature::CanAssistTo(), i_enemy, i_funit, i_range, WorldObject::IsWithinDistInMap(), and WorldObject::IsWithinLOSInMap().

Member Data Documentation

◆ i_enemy

Unit* const Acore::AnyAssistCreatureInRangeCheck::i_enemy
private

Referenced by operator()().

◆ i_funit

Unit* const Acore::AnyAssistCreatureInRangeCheck::i_funit
private

Referenced by operator()().

◆ i_range

float Acore::AnyAssistCreatureInRangeCheck::i_range
private

Referenced by operator()().