diff options
author | megamage <none@none> | 2008-12-17 18:45:54 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-17 18:45:54 -0600 |
commit | 01db065cebc656ff1936731a3a0aa4ceece6e8dd (patch) | |
tree | bda773269df448fa1790d61da398dc2b2b42a43c /src/game/Unit.cpp | |
parent | 32a9420289e9f4a17927fd0644d7f4edc6119b9a (diff) |
*Let feign death interrupt enemies' casting.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
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<Unit *> targets; - - { - Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist); - Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check); - - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); - - CellLock<GridReadGuard> 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<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check); + VisitNearbyObject(dist, searcher); // remove current target if(getVictim()) |