mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
This commit is contained in:
@@ -2948,7 +2948,7 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
|
||||
{
|
||||
Trinity::AllWorldObjectsInRange u_check(obj, dist);
|
||||
Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
|
||||
obj->VisitNearbyObject(dist, searcher);
|
||||
Cell::VisitAllObjects(obj, searcher, dist);
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
@@ -3823,18 +3823,10 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
||||
if (!me)
|
||||
return nullptr;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Unit* unit = nullptr;
|
||||
|
||||
Trinity::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, range);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@@ -3843,16 +3835,9 @@ void SmartScript::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::FriendlyCCedInRange u_check(me, range);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, _list, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
}
|
||||
|
||||
void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float range, uint32 spellid)
|
||||
@@ -3860,16 +3845,9 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
}
|
||||
|
||||
Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
||||
@@ -3880,7 +3858,7 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
||||
Unit* unit = nullptr;
|
||||
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
Cell::VisitAllObjects(me, searcher, range);
|
||||
return unit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user