VisitAllObjects to VisitObjects (sync with acore) (#1513)

This commit is contained in:
Yunfan Li
2025-08-09 19:17:33 +08:00
committed by GitHub
parent 966bf1d6af
commit a307eb2f08
13 changed files with 22 additions and 22 deletions

View File

@@ -2180,7 +2180,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot)
float range = sPlayerbotAIConfig->randomBotTeleportDistance;
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
if (!targets.empty())
{

View File

@@ -39,7 +39,7 @@ bool RevealGatheringItemAction::Execute(Event event)
std::list<GameObject*> targets;
AnyGameObjectInObjectRangeCheck u_check(bot, sPlayerbotAIConfig->grindDistance);
Acore::GameObjectListSearcher<AnyGameObjectInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, sPlayerbotAIConfig->reactDistance);
Cell::VisitObjects(bot, searcher, sPlayerbotAIConfig->reactDistance);
std::vector<GameObject*> result;
for (GameObject* go : targets)

View File

@@ -23,7 +23,7 @@ bool TravelAction::Execute(Event event)
std::list<Unit*> targets;
Acore::AnyUnitInObjectRangeCheck u_check(bot, sPlayerbotAIConfig->sightDistance * 2);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, sPlayerbotAIConfig->sightDistance);
Cell::VisitObjects(bot, searcher, sPlayerbotAIConfig->sightDistance);
for (Unit* unit : targets)
{

View File

@@ -110,7 +110,7 @@ bool SummonAction::SummonUsingGos(Player* summoner, Player* player)
std::list<GameObject*> targets;
AnyGameObjectInObjectRangeCheck u_check(summoner, sPlayerbotAIConfig->sightDistance);
Acore::GameObjectListSearcher<AnyGameObjectInObjectRangeCheck> searcher(summoner, targets, u_check);
Cell::VisitAllObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance);
Cell::VisitObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance);
for (GameObject* go : targets)
{
@@ -130,7 +130,7 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player)
std::list<Unit*> targets;
Acore::AnyUnitInObjectRangeCheck u_check(summoner, sPlayerbotAIConfig->sightDistance);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(summoner, targets, u_check);
Cell::VisitAllObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance);
Cell::VisitObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance);
for (Unit* unit : targets)
{

View File

@@ -6549,7 +6549,7 @@ bool IccSindragosaFrostBombAction::Execute(Event event)
float range = 200.0f;
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, units, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
for (Unit* unit : units)
{

View File

@@ -21,7 +21,7 @@ bool CollisionValue::Calculate()
float range = sPlayerbotAIConfig->contactDistance;
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
for (Unit* target : targets)
{

View File

@@ -26,7 +26,7 @@ void NearestCorpsesValue::FindUnits(std::list<Unit*>& targets)
{
AnyDeadUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<AnyDeadUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestCorpsesValue::AcceptUnit(Unit* unit) { return true; }

View File

@@ -14,7 +14,7 @@ void NearestFriendlyPlayersValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyFriendlyUnitInObjectRangeCheck u_check(bot, bot, range);
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestFriendlyPlayersValue::AcceptUnit(Unit* unit)

View File

@@ -17,7 +17,7 @@ GuidVector NearestGameObjects::Calculate()
std::list<GameObject*> targets;
AnyGameObjectInObjectRangeCheck u_check(bot, range);
Acore::GameObjectListSearcher<AnyGameObjectInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
GuidVector result;
for (GameObject* go : targets)
@@ -34,7 +34,7 @@ GuidVector NearestTrapWithDamageValue::Calculate()
std::list<GameObject*> targets;
AnyGameObjectInObjectRangeCheck u_check(bot, range);
Acore::GameObjectListSearcher<AnyGameObjectInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
GuidVector result;
for (GameObject* go : targets)

View File

@@ -14,7 +14,7 @@ void NearestNonBotPlayersValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestNonBotPlayersValue::AcceptUnit(Unit* unit)

View File

@@ -15,7 +15,7 @@ void NearestNpcsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestNpcsValue::AcceptUnit(Unit* unit) { return !unit->IsPlayer(); }
@@ -24,7 +24,7 @@ void NearestHostileNpcsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestHostileNpcsValue::AcceptUnit(Unit* unit) { return unit->IsHostileTo(bot) && !unit->IsPlayer(); }
@@ -33,7 +33,7 @@ void NearestVehiclesValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestVehiclesValue::AcceptUnit(Unit* unit)
@@ -52,7 +52,7 @@ void NearestTriggersValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range);
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestTriggersValue::AcceptUnit(Unit* unit) { return !unit->IsPlayer(); }
@@ -61,7 +61,7 @@ void NearestTotemsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool NearestTotemsValue::AcceptUnit(Unit* unit) { return unit->IsTotem(); }

View File

@@ -49,7 +49,7 @@ void PossibleRpgTargetsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool PossibleRpgTargetsValue::AcceptUnit(Unit* unit)
@@ -141,7 +141,7 @@ void PossibleNewRpgTargetsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool PossibleNewRpgTargetsValue::AcceptUnit(Unit* unit)
@@ -168,7 +168,7 @@ GuidVector PossibleNewRpgGameObjectsValue::Calculate()
std::list<GameObject*> targets;
AnyGameObjectInObjectRangeCheck u_check(bot, range);
Acore::GameObjectListSearcher<AnyGameObjectInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
std::vector<std::pair<ObjectGuid, float>> guidDistancePairs;

View File

@@ -21,7 +21,7 @@ void PossibleTargetsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range);
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool PossibleTargetsValue::AcceptUnit(Unit* unit) { return AttackersValue::IsPossibleTarget(unit, bot, range); }
@@ -30,7 +30,7 @@ void PossibleTriggersValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range);
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
Cell::VisitObjects(bot, searcher, range);
}
bool PossibleTriggersValue::AcceptUnit(Unit* unit)