mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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))
|
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
std::list<Player*> targets;
|
||||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
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);
|
||||||
{
|
}
|
||||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
|
else
|
||||||
}
|
{
|
||||||
else
|
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
|
||||||
{
|
|
||||||
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user