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

@@ -888,17 +888,12 @@ void hyjalAI::JustDied(Unit* /*killer*/)
void hyjalAI::HideNearPos(float x, float y)
{
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
// First get all creatures.
std::list<Creature*> creatures;
Acore::AllFriendlyCreaturesInGrid creature_check(me);
Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor <Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher);
cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
Cell::VisitGridObjects(x, y, me->GetMap(), creature_searcher, me->GetGridActivationRange());
if (!creatures.empty())
{
@@ -912,14 +907,9 @@ void hyjalAI::HideNearPos(float x, float y)
void hyjalAI::RespawnNearPos(float x, float y)
{
CellCoord p(Acore::ComputeCellCoord(x, y));
Cell cell(p);
cell.SetNoCreate();
Acore::RespawnDo u_do;
Acore::WorldObjectWorker<Acore::RespawnDo> worker(me, u_do);
TypeContainerVisitor<Acore::WorldObjectWorker<Acore::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange());
Cell::VisitGridObjects(x, y, me->GetMap(), worker, me->GetGridActivationRange());
}
void hyjalAI::WaypointReached(uint32 waypointId)
@@ -943,19 +933,11 @@ void hyjalAI::WaypointReached(uint32 waypointId)
}
//do some talking
//all alive guards walk near here
CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
// First get all creatures.
std::list<Creature*> creatures;
Acore::AllFriendlyCreaturesInGrid creature_check(me);
Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
if (!creatures.empty())
{
@@ -984,18 +966,10 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
if (TeleportTimer <= diff)
{
CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
std::list<Creature*> creatures;
Acore::AllFriendlyCreaturesInGrid creature_check(me);
Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
if (!creatures.empty())
{