aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.cpp
diff options
context:
space:
mode:
authorNeo2003 <none@none>2008-10-05 11:38:24 -0500
committerNeo2003 <none@none>2008-10-05 11:38:24 -0500
commit1fc73ff41b0b113ee0cbc072f8ed81a2c572924c (patch)
treee2921caa16730e21b3e7988c2bbb1a12f8fce2b1 /src/game/Object.cpp
parent9245de813869b8c386b651204678d1a1b4d84ea7 (diff)
[svn] * PlaySound changed to SendPlaySound, moved to WorldObject and used everywhere instead of hard-coding packet
--HG-- branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r--src/game/Object.cpp10
1 files changed, 10 insertions, 0 deletions
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