Sound: add Sound_Stop() to make that task more slightly more accessible.

This commit is contained in:
Marco Cawthorne 2024-02-21 16:11:14 -08:00
parent 33e5038881
commit 29a997dbcf
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 9 additions and 0 deletions

View File

@ -109,4 +109,7 @@ int Sound_GetID(string sndDef);
void Sound_Speak(entity targetEntity, string sentencesEntry);
#endif
/** Stops sounds on a given channel, on a target entity. */
void Sound_Stop(entity target, int chan);
void Sound_DebugList();

View File

@ -577,6 +577,12 @@ Sound_DistancePos(vector pos, string shader)
pointsound_proper(pos, argv(r), volume, ATTN_NONE, pitch);
}
void
Sound_Stop(entity target, int chan)
{
sound(target, chan, "common/null.wav", 1.0f, ATTN_NORM, 100, SOUNDFLAG_FOLLOW, 0 );
}
void
Sound_Play(entity target, int chan, string shader)
{