Core/Event: Change Midsummer Music to search grid only

This commit is contained in:
Kittnz
2016-10-14 18:05:06 +02:00
committed by Aokromes
parent 496268c478
commit de78de624e

View File

@@ -1358,30 +1358,23 @@ public:
{
switch (eventId)
{
case EVENT_MM_START_MUSIC:
{
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
break;
Map::PlayerList const &players = go->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
case EVENT_MM_START_MUSIC:
{
if (Player* player = itr->GetSource())
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
break;
std::deque<Player*> playersNearby;
go->GetPlayerListInGrid(playersNearby, go->GetMap()->GetVisibilityRange());
for (Player* player : playersNearby)
{
if (player->GetTeamId() == TEAM_HORDE)
{
go->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
}
else
{
go->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
}
}
_events.ScheduleEvent(EVENT_MM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
break;
}
_events.ScheduleEvent(EVENT_MM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
break;
}
default:
break;
}