Core/Packets: converted SMSG_PLAY_SOUND and SMSG_PLAY_OBJECT_SOUND to packet class and corrected packet structure of

SMSG_PLAY_OBJECT_SOUND
This commit is contained in:
Ovahlord committed 2020-04-05 19:28:49 +02:00
1 parent c7f5732571
commit 9bf01799f0
11 files changed
+74 -48

No files matched your search

+3 -5
View File
@@ -24,6 +24,7 @@
#include "DBCStores.h"
#include "GridNotifiersImpl.h"
#include "Log.h"
#include "MiscPackets.h"
#include "ObjectMgr.h"
#include "World.h"
@@ -305,13 +306,10 @@ void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType,
if (!sound || !source)
return;
WorldPacket data(SMSG_PLAY_SOUND, 4 + 8);
data << uint32(sound);
// data << uint64(source->GetGUID()); Todo: find out why some maps prevent the sound from appearing
SendNonChatPacket(source, &data, msgType, whisperTarget, range, team, gmOnly);
SendNonChatPacket(source, WorldPackets::Misc::PlaySound(source->GetGUID(), sound).Write(), msgType, whisperTarget, range, team, gmOnly);
}
void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const
void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const
{
switch (msgType)
{