From 1fc73ff41b0b113ee0cbc072f8ed81a2c572924c Mon Sep 17 00:00:00 2001 From: Neo2003 Date: Sun, 5 Oct 2008 11:38:24 -0500 Subject: [svn] * PlaySound changed to SendPlaySound, moved to WorldObject and used everywhere instead of hard-coding packet --HG-- branch : trunk --- src/game/Object.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/game/Object.cpp') diff --git a/src/game/Object.cpp b/src/game/Object.cpp index b3e61e102d3..fd6411afc07 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1166,6 +1166,16 @@ void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossW player->GetSession()->SendPacket(&data); } +void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf) +{ + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << Sound; + if (OnlySelf && GetTypeId() == TYPEID_PLAYER ) + ((Player*)this)->GetSession()->SendPacket( &data ); + else + SendMessageToSet( &data, true ); // ToSelf ignored in this case +} + namespace MaNGOS { class MessageChatLocaleCacheDo -- cgit v1.2.3