refactor(Core/Grids): Ported cmangos/mangos-wotlk@ea99457 (#6113)

* refactor(Core/Grids): Ported cmangos/mangos-wotlk@ea99457

(cherry picked from commit d6201e5dbb)
Co-Authored-By: Shauren <shauren.trinity@gmail.com>
Co-Authored-By: SilverIce <slifeleaf@gmail.com>

* Update CellImpl.h

* w

* more more brackets

* ew

* fix build
This commit is contained in:
Kitzunu
2021-06-03 05:27:51 +02:00
committed by GitHub
parent cc28cf6bf0
commit 7152ddc82c
46 changed files with 238 additions and 361 deletions

View File

@@ -610,9 +610,7 @@ void GameObject::Update(uint32 diff)
{
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
Acore::UnitSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
VisitNearbyGridObject(radius, searcher);
if (!target)
VisitNearbyWorldObject(radius, searcher);
Cell::VisitAllObjects(this, searcher, radius);
}
else // environmental trap
{
@@ -621,7 +619,7 @@ void GameObject::Update(uint32 diff)
Player* player = nullptr;
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
VisitNearbyWorldObject(radius, searcher);
Cell::VisitWorldObjects(this, searcher, radius);
target = player;
}
@@ -1209,14 +1207,10 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
{
GameObject* ok = nullptr;
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
Acore::NearestGameObjectFishingHole u_check(*this, range);
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
TypeContainerVisitor<Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
Cell::VisitGridObjects(this, checker, range);
return ok;
}
@@ -1978,7 +1972,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
if (includeMargin)
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
VisitNearbyWorldObject(dist, notifier);
Cell::VisitWorldObjects(this, notifier, dist);
}
void GameObject::EventInform(uint32 eventId)