aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 68b8ab1feae..33d1fd2ea02 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1822,6 +1822,29 @@ void Creature::DoFleeToGetAssistance(float radius) // Optional parameter
}
}
+Unit* Creature::SelectNearestTarget(float dist) const
+{
+ /*CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Unit *target;
+
+ {
+ Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
+ Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(target, u_check);
+
+ TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+ TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, world_unit_searcher, GetMap());
+ cell_lock->Visit(cell_lock, grid_unit_searcher, GetMap());
+ }*/
+ return NULL;
+}
+
void Creature::CallAssistence()
{
if( !m_AlreadyCallAssistence && getVictim() && !isPet() && !isCharmed())