mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Scripts): Midsummer Music Range (#12248)
* fix(Scripts): Midsummer Music Range * Refactor iterating nearby players Co-authored-by: Nefertumm <nefertum.dev@protonmail.com> * Update go_scripts.cpp * Update go_scripts.cpp Co-authored-by: Nefertumm <nefertum.dev@protonmail.com>
This commit is contained in:
@@ -821,19 +821,19 @@ public:
|
||||
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
|
||||
break;
|
||||
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
std::list<Player*> targets;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(me, me->GetVisibilityRange(), false);
|
||||
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(me, targets, check);
|
||||
Cell::VisitWorldObjects(me, searcher, me->GetVisibilityRange());
|
||||
for (Player* player : targets)
|
||||
{
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetTeamId() == TEAM_HORDE)
|
||||
{
|
||||
if (player->GetTeamId() == TEAM_HORDE)
|
||||
{
|
||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
|
||||
}
|
||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user