From 0f9a0accf17ba3a9f20d6a7575b51ed2cb09a73c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Jun 2025 01:07:44 +0200 Subject: Core/Misc: Kill AnyPlayerInObjectRangeCheck (duplicate of AnyUnitInObjectRangeCheck) --- src/server/scripts/Events/love_is_in_the_air.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/server/scripts/Events') diff --git a/src/server/scripts/Events/love_is_in_the_air.cpp b/src/server/scripts/Events/love_is_in_the_air.cpp index 937aefd7fa7..10a5448c43b 100644 --- a/src/server/scripts/Events/love_is_in_the_air.cpp +++ b/src/server/scripts/Events/love_is_in_the_air.cpp @@ -16,10 +16,8 @@ */ #include "ScriptMgr.h" -#include "CellImpl.h" #include "Containers.h" #include "CreatureAIImpl.h" -#include "GridNotifiersImpl.h" #include "Player.h" #include "SpellAuraEffects.h" #include "SpellScript.h" @@ -75,21 +73,16 @@ class spell_love_is_in_the_air_romantic_picnic : public AuraScript bool foundSomeone = false; // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123) // required by achievement and "hearts" visual - std::list playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE*2); - Trinity::PlayerListSearcher searcher(target, playerList, checker); - Cell::VisitWorldObjects(target, searcher, INTERACTION_DISTANCE * 2); - for (std::list::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) + std::vector playerList; + target->GetPlayerListInGrid(playerList, INTERACTION_DISTANCE * 2); + for (Player* playerFound : playerList) { - if (Player* playerFound = (*itr)) + if (target != playerFound && playerFound->HasAura(GetId())) { - if (target != playerFound && playerFound->HasAura(GetId())) - { - playerFound->CastSpell(playerFound, SPELL_ROMANTIC_PICNIC_ACHIEV, true); - target->CastSpell(target, SPELL_ROMANTIC_PICNIC_ACHIEV, true); - foundSomeone = true; - break; - } + playerFound->CastSpell(playerFound, SPELL_ROMANTIC_PICNIC_ACHIEV, true); + target->CastSpell(target, SPELL_ROMANTIC_PICNIC_ACHIEV, true); + foundSomeone = true; + break; } } -- cgit v1.2.3