feat(Core): GetDeadCreatureListInGrid helper added, for aoe loot (#8445)

This commit is contained in:
acidmanifesto
2021-10-13 10:32:01 -04:00
committed by GitHub
parent b5f8b485a8
commit 430157f71d
5 changed files with 38 additions and 0 deletions

View File

@@ -1327,6 +1327,30 @@ namespace Acore
float m_fRange;
};
class AllDeadCreaturesInRange
{
public:
AllDeadCreaturesInRange(WorldObject const* obj, float range, bool reqAlive = true) : _obj(obj), _range(range), _reqAlive(reqAlive) {}
bool operator()(Unit* unit) const
{
if (_reqAlive && unit->IsAlive())
{
return false;
}
if (!_obj->IsWithinDistInMap(unit, _range))
{
return false;
}
return true;
}
private:
WorldObject const* _obj;
float _range;
bool _reqAlive;
};
class PlayerAtMinimumRangeAway
{
public: