From 01db065cebc656ff1936731a3a0aa4ceece6e8dd Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 17 Dec 2008 18:45:54 -0600 Subject: *Let feign death interrupt enemies' casting. --HG-- branch : trunk --- src/game/Unit.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 19ea4029cf8..f3a0b56c1fa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12089,24 +12089,10 @@ void Unit::UpdateReactives( uint32 p_time ) Unit* Unit::SelectNearbyTarget(float dist) const { - CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - std::list targets; - - { - Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist); - Trinity::UnitListSearcher searcher(targets, u_check); - - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); - - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this)); - cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this)); - } + Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist); + Trinity::UnitListSearcher searcher(targets, u_check); + VisitNearbyObject(dist, searcher); // remove current target if(getVictim()) -- cgit v1.2.3