From a307eb2f088f57c26feb425d2d817eef076ab5be Mon Sep 17 00:00:00 2001 From: Yunfan Li <56597220+liyunfan1223@users.noreply.github.com> Date: Sat, 9 Aug 2025 19:17:33 +0800 Subject: [PATCH] VisitAllObjects to VisitObjects (sync with acore) (#1513) --- src/RandomPlayerbotMgr.cpp | 2 +- src/strategy/actions/RevealGatheringItemAction.cpp | 2 +- src/strategy/actions/TravelAction.cpp | 2 +- src/strategy/actions/UseMeetingStoneAction.cpp | 4 ++-- src/strategy/raids/icecrown/RaidIccActions.cpp | 2 +- src/strategy/values/CollisionValue.cpp | 2 +- src/strategy/values/NearestCorpsesValue.cpp | 2 +- src/strategy/values/NearestFriendlyPlayersValue.cpp | 2 +- src/strategy/values/NearestGameObjects.cpp | 4 ++-- src/strategy/values/NearestNonBotPlayersValue.cpp | 2 +- src/strategy/values/NearestNpcsValue.cpp | 10 +++++----- src/strategy/values/PossibleRpgTargetsValue.cpp | 6 +++--- src/strategy/values/PossibleTargetsValue.cpp | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index fd29b1df..1b69d7f3 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -2180,7 +2180,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot) float range = sPlayerbotAIConfig->randomBotTeleportDistance; Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); if (!targets.empty()) { diff --git a/src/strategy/actions/RevealGatheringItemAction.cpp b/src/strategy/actions/RevealGatheringItemAction.cpp index 75b6548d..5697347f 100644 --- a/src/strategy/actions/RevealGatheringItemAction.cpp +++ b/src/strategy/actions/RevealGatheringItemAction.cpp @@ -39,7 +39,7 @@ bool RevealGatheringItemAction::Execute(Event event) std::list targets; AnyGameObjectInObjectRangeCheck u_check(bot, sPlayerbotAIConfig->grindDistance); Acore::GameObjectListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, sPlayerbotAIConfig->reactDistance); + Cell::VisitObjects(bot, searcher, sPlayerbotAIConfig->reactDistance); std::vector result; for (GameObject* go : targets) diff --git a/src/strategy/actions/TravelAction.cpp b/src/strategy/actions/TravelAction.cpp index 60a3244c..4d7ce96e 100644 --- a/src/strategy/actions/TravelAction.cpp +++ b/src/strategy/actions/TravelAction.cpp @@ -23,7 +23,7 @@ bool TravelAction::Execute(Event event) std::list targets; Acore::AnyUnitInObjectRangeCheck u_check(bot, sPlayerbotAIConfig->sightDistance * 2); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, sPlayerbotAIConfig->sightDistance); + Cell::VisitObjects(bot, searcher, sPlayerbotAIConfig->sightDistance); for (Unit* unit : targets) { diff --git a/src/strategy/actions/UseMeetingStoneAction.cpp b/src/strategy/actions/UseMeetingStoneAction.cpp index 025092cf..8319ee3b 100644 --- a/src/strategy/actions/UseMeetingStoneAction.cpp +++ b/src/strategy/actions/UseMeetingStoneAction.cpp @@ -110,7 +110,7 @@ bool SummonAction::SummonUsingGos(Player* summoner, Player* player) std::list targets; AnyGameObjectInObjectRangeCheck u_check(summoner, sPlayerbotAIConfig->sightDistance); Acore::GameObjectListSearcher 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 targets; Acore::AnyUnitInObjectRangeCheck u_check(summoner, sPlayerbotAIConfig->sightDistance); Acore::UnitListSearcher searcher(summoner, targets, u_check); - Cell::VisitAllObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance); + Cell::VisitObjects(summoner, searcher, sPlayerbotAIConfig->sightDistance); for (Unit* unit : targets) { diff --git a/src/strategy/raids/icecrown/RaidIccActions.cpp b/src/strategy/raids/icecrown/RaidIccActions.cpp index 5207290a..eaad5d2f 100644 --- a/src/strategy/raids/icecrown/RaidIccActions.cpp +++ b/src/strategy/raids/icecrown/RaidIccActions.cpp @@ -6549,7 +6549,7 @@ bool IccSindragosaFrostBombAction::Execute(Event event) float range = 200.0f; Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, units, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); for (Unit* unit : units) { diff --git a/src/strategy/values/CollisionValue.cpp b/src/strategy/values/CollisionValue.cpp index 119bfc94..52ae8f06 100644 --- a/src/strategy/values/CollisionValue.cpp +++ b/src/strategy/values/CollisionValue.cpp @@ -21,7 +21,7 @@ bool CollisionValue::Calculate() float range = sPlayerbotAIConfig->contactDistance; Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); for (Unit* target : targets) { diff --git a/src/strategy/values/NearestCorpsesValue.cpp b/src/strategy/values/NearestCorpsesValue.cpp index b79e7422..59fe3167 100644 --- a/src/strategy/values/NearestCorpsesValue.cpp +++ b/src/strategy/values/NearestCorpsesValue.cpp @@ -26,7 +26,7 @@ void NearestCorpsesValue::FindUnits(std::list& targets) { AnyDeadUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); } bool NearestCorpsesValue::AcceptUnit(Unit* unit) { return true; } diff --git a/src/strategy/values/NearestFriendlyPlayersValue.cpp b/src/strategy/values/NearestFriendlyPlayersValue.cpp index 2a0ee89e..f8f92ad0 100644 --- a/src/strategy/values/NearestFriendlyPlayersValue.cpp +++ b/src/strategy/values/NearestFriendlyPlayersValue.cpp @@ -14,7 +14,7 @@ void NearestFriendlyPlayersValue::FindUnits(std::list& targets) { Acore::AnyFriendlyUnitInObjectRangeCheck u_check(bot, bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); } bool NearestFriendlyPlayersValue::AcceptUnit(Unit* unit) diff --git a/src/strategy/values/NearestGameObjects.cpp b/src/strategy/values/NearestGameObjects.cpp index 85a34282..131c730f 100644 --- a/src/strategy/values/NearestGameObjects.cpp +++ b/src/strategy/values/NearestGameObjects.cpp @@ -17,7 +17,7 @@ GuidVector NearestGameObjects::Calculate() std::list targets; AnyGameObjectInObjectRangeCheck u_check(bot, range); Acore::GameObjectListSearcher 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 targets; AnyGameObjectInObjectRangeCheck u_check(bot, range); Acore::GameObjectListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); GuidVector result; for (GameObject* go : targets) diff --git a/src/strategy/values/NearestNonBotPlayersValue.cpp b/src/strategy/values/NearestNonBotPlayersValue.cpp index 6ab733e8..1fb72360 100644 --- a/src/strategy/values/NearestNonBotPlayersValue.cpp +++ b/src/strategy/values/NearestNonBotPlayersValue.cpp @@ -14,7 +14,7 @@ void NearestNonBotPlayersValue::FindUnits(std::list& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); } bool NearestNonBotPlayersValue::AcceptUnit(Unit* unit) diff --git a/src/strategy/values/NearestNpcsValue.cpp b/src/strategy/values/NearestNpcsValue.cpp index 3b9e553f..b2b510da 100644 --- a/src/strategy/values/NearestNpcsValue.cpp +++ b/src/strategy/values/NearestNpcsValue.cpp @@ -15,7 +15,7 @@ void NearestNpcsValue::FindUnits(std::list& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); } bool NearestTotemsValue::AcceptUnit(Unit* unit) { return unit->IsTotem(); } diff --git a/src/strategy/values/PossibleRpgTargetsValue.cpp b/src/strategy/values/PossibleRpgTargetsValue.cpp index cee20d9b..858bc2ba 100644 --- a/src/strategy/values/PossibleRpgTargetsValue.cpp +++ b/src/strategy/values/PossibleRpgTargetsValue.cpp @@ -49,7 +49,7 @@ void PossibleRpgTargetsValue::FindUnits(std::list& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnitInObjectRangeCheck u_check(bot, range); Acore::UnitListSearcher 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 targets; AnyGameObjectInObjectRangeCheck u_check(bot, range); Acore::GameObjectListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); std::vector> guidDistancePairs; diff --git a/src/strategy/values/PossibleTargetsValue.cpp b/src/strategy/values/PossibleTargetsValue.cpp index f4622298..6d31993d 100644 --- a/src/strategy/values/PossibleTargetsValue.cpp +++ b/src/strategy/values/PossibleTargetsValue.cpp @@ -21,7 +21,7 @@ void PossibleTargetsValue::FindUnits(std::list& targets) { Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range); Acore::UnitListSearcher 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& targets) { Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, range); Acore::UnitListSearcher searcher(bot, targets, u_check); - Cell::VisitAllObjects(bot, searcher, range); + Cell::VisitObjects(bot, searcher, range); } bool PossibleTriggersValue::AcceptUnit(Unit* unit)