Core/Commands: Add optional broadcast text id argument to .debug play sound command

This commit is contained in:
Shauren
2020-12-30 23:01:37 +01:00
parent e26122dc54
commit d94f0d23b3

View File

@@ -191,7 +191,9 @@ public:
return false;
}
uint32 soundId = atoul(args);
char const* soundIdToken = strtok((char*)args, " ");
uint32 soundId = atoul(soundIdToken);
if (!sSoundKitStore.LookupEntry(soundId))
{
@@ -210,10 +212,15 @@ public:
return false;
}
uint32 broadcastTextId = 0;
char const* broadcastTextIdToken = strtok(nullptr, " ");
if (broadcastTextIdToken)
broadcastTextId = atoul(broadcastTextIdToken);
if (player->GetTarget().IsEmpty())
unit->PlayDistanceSound(soundId, player);
else
unit->PlayDirectSound(soundId, player);
unit->PlayDirectSound(soundId, player, broadcastTextId);
handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundId);
return true;