mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix/feat: (Core/PacketIO): updated sound and creature addon (#10813)
* fix\feat: (Core/PacketIO): updated sound and creature addon
updated SMSG_PLAY_SOUND, SMSG_PLAY_MUSIC and SMSG_PLAY_OBJECT_SOUND via tc cherry pick
https://github.com/TrinityCore/TrinityCore/pull/2363 and 0f1f7ef401 by @joschiwald and @ForesterDev
This so far a attempt to align atleast with sound with tc, and correct a potentional issue of hearing creature sounds that is not in visible range. I notice PlaySound was being defined in some weird dependency as it isnt with tc so I renamed it to Playsound. Notice a isLarge still being used in the creature addon when it was depreciated, so i removed that a that seem to of interfered with visibilitydistanceType.
Co-Authored-By: joschiwald <736792+joschiwald@users.noreply.github.com>
Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
This commit is contained in:
@@ -721,9 +721,9 @@ void Map::ScriptsProcess()
|
||||
// Source must be WorldObject.
|
||||
if (WorldObject* object = _GetScriptWorldObject(source, true, step.script))
|
||||
{
|
||||
// PlaySound.Flags bitmask: 0/1=anyone/target
|
||||
// Playsound.Flags bitmask: 0/1=anyone/target
|
||||
Player* player = nullptr;
|
||||
if (step.script->PlaySound.Flags & SF_PLAYSOUND_TARGET_PLAYER)
|
||||
if (step.script->Playsound.Flags & SF_PLAYSOUND_TARGET_PLAYER)
|
||||
{
|
||||
// Target must be Player.
|
||||
player = _GetScriptPlayer(target, false, step.script);
|
||||
@@ -731,11 +731,11 @@ void Map::ScriptsProcess()
|
||||
break;
|
||||
}
|
||||
|
||||
// PlaySound.Flags bitmask: 0/2=without/with distance dependent
|
||||
if (step.script->PlaySound.Flags & SF_PLAYSOUND_DISTANCE_SOUND)
|
||||
object->PlayDistanceSound(step.script->PlaySound.SoundID, player);
|
||||
// Playsound.Flags bitmask: 0/2=without/with distance dependent
|
||||
if (step.script->Playsound.Flags & SF_PLAYSOUND_DISTANCE_SOUND)
|
||||
object->PlayDistanceSound(step.script->Playsound.SoundID, player);
|
||||
else
|
||||
object->PlayDirectSound(step.script->PlaySound.SoundID, player);
|
||||
object->PlayDirectSound(step.script->Playsound.SoundID, player);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user