mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 12:42:43 -04:00
Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
(cherry picked from commit 9299e9bde0)
This commit is contained in:
@@ -582,7 +582,7 @@ void GameObject::Update(uint32 diff)
|
||||
// Hunter trap: Search units which are unfriendly to the trap's owner
|
||||
Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(radius, searcher);
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -590,7 +590,7 @@ void GameObject::Update(uint32 diff)
|
||||
Player* player = nullptr;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, radius);
|
||||
Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
Cell::VisitWorldObjects(this, searcher, radius);
|
||||
target = player;
|
||||
}
|
||||
|
||||
@@ -1166,15 +1166,9 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = nullptr;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
Trinity::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
Cell::VisitGridObjects(this, checker, range);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user