diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-06-08 01:07:44 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-06-08 01:07:44 +0200 |
commit | 0f9a0accf17ba3a9f20d6a7575b51ed2cb09a73c (patch) | |
tree | 2a883a8df46b6d90fb2d2cba3edfead398216f94 /src/server/scripts/Events | |
parent | aab8cdec35d66e895679d0e2e179331cfe19efc0 (diff) |
Core/Misc: Kill AnyPlayerInObjectRangeCheck (duplicate of AnyUnitInObjectRangeCheck)
Diffstat (limited to 'src/server/scripts/Events')
-rw-r--r-- | src/server/scripts/Events/love_is_in_the_air.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
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<Player*> playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE*2); - Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker); - Cell::VisitWorldObjects(target, searcher, INTERACTION_DISTANCE * 2); - for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) + std::vector<Player*> 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; } } |