diff options
| author | Golrag <golrag.jeremy@gmail.com> | 2015-04-17 09:33:41 +0200 |
|---|---|---|
| committer | Golrag <golrag.jeremy@gmail.com> | 2015-04-17 11:45:07 +0200 |
| commit | 82a33c7fa868d5ace7f855dba26b5f41c12bab6e (patch) | |
| tree | 304c6bacc7d02b8027fd33b2f6d0ac0f3b35ada3 /src/server/game/Battlegrounds/Battleground.cpp | |
| parent | 280a0b8e35ccf2fde55199938dffb2851892eaa2 (diff) | |
Core/PacketIO: SMSG_PLAY_SOUND
Diffstat (limited to 'src/server/game/Battlegrounds/Battleground.cpp')
| -rw-r--r-- | src/server/game/Battlegrounds/Battleground.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d25d88ec389..c9dbee66445 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -39,6 +39,7 @@ #include "WorldPacket.h" #include "Transport.h" #include "BattlegroundPackets.h" +#include "MiscPackets.h" namespace Trinity { @@ -667,22 +668,18 @@ void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* sCreatureTextMgr->SendChat(source, textId, target); } -void Battleground::PlaySoundToAll(uint32 SoundID) +void Battleground::PlaySoundToAll(uint32 soundID) { - WorldPacket data; - sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); - SendPacketToAll(&data); + SendPacketToAll(WorldPackets::Misc::PlaySound(ObjectGuid::Empty, soundID).Write()); } -void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) +void Battleground::PlaySoundToTeam(uint32 soundID, uint32 teamID) { - WorldPacket data; for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - if (Player* player = _GetPlayerForTeam(TeamID, itr, "PlaySoundToTeam")) - { - sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); - player->SendDirectMessage(&data); - } + { + if (Player* player = _GetPlayerForTeam(teamID, itr, "PlaySoundToTeam")) + player->SendDirectMessage(WorldPackets::Misc::PlaySound(ObjectGuid::Empty, soundID).Write()); + } } void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID) |
