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

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

(cherry picked from commit https://github.com/TrinityCore/TrinityCore/commit/d6201e5dbb7fa7ca8b47ffa6c0d30fa38dceada5)
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
+1 -1
View File
@@ -73,7 +73,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
victim = nullptr;
Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
me->VisitNearbyObject(max_range, checker);
Cell::VisitAllObjects(me, checker, max_range);
}
if (!victim && me->GetCharmerOrOwnerOrSelf()->IsInCombat())
@@ -381,7 +381,7 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
Unit* unit = nullptr;
Acore::MostHPMissingInRange u_check(me, range, minHPDiff);
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(me, searcher, range);
return unit;
}
@@ -391,7 +391,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
std::list<Creature*> list;
Acore::FriendlyCCedInRange u_check(me, range);
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(me, searcher, range);
return list;
}
@@ -400,7 +400,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
std::list<Creature*> list;
Acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(me, searcher, range);
return list;
}
@@ -408,15 +408,10 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
{
Player* player = nullptr;
CellCoord pair(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
cell.SetNoCreate();
Acore::PlayerAtMinimumRangeAway check(me, minimumRange);
Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
TypeContainerVisitor<Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
cell.Visit(pair, visitor, *me->GetMap(), *me, minimumRange);
Cell::VisitWorldObjects(me, searcher, minimumRange);
return player;
}
@@ -3881,7 +3881,7 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
{
Acore::AllWorldObjectsInRange u_check(obj, dist);
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
obj->VisitNearbyObject(dist, searcher);
Cell::VisitAllObjects(obj, searcher, dist);
}
return targets;
}
@@ -4864,7 +4864,7 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
Acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
return unit;
}
@@ -4875,7 +4875,7 @@ void SmartScript::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
Acore::FriendlyCCedInRange u_check(me, range);
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, _list, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
}
void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float range, uint32 spellid)
@@ -4885,7 +4885,7 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
Acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitGridObjects(me, searcher, range);
}
Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
@@ -4896,7 +4896,7 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
Unit* unit = nullptr;
Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
Acore::UnitLastSearcher<Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(me, searcher, range);
return unit;
}