SoundDef: add helper function int Sound_GetID(string)
This commit is contained in:
parent
49408b1342
commit
d7ddfc1c87
2 changed files with 10 additions and 0 deletions
|
@ -93,6 +93,8 @@ void Sound_PlayAt(vector worldPos, string sndDef);
|
|||
void Sound_PlayLocal(string shader);
|
||||
/** Client-side only: Update the sound parameters on a given entity. */
|
||||
void Sound_Update(entity targetEntity, int sndChannel, int sndSample, float desiredVolume);
|
||||
|
||||
int Sound_GetID(string sndDef);
|
||||
#else
|
||||
/** Server-side only: Play a sentences.txt entry on a given entity. */
|
||||
void Sound_Speak(entity targetEntity, string sentencesEntry);
|
||||
|
|
|
@ -790,6 +790,14 @@ Sound_PlayLocal(string shader)
|
|||
localsound(argv(r));
|
||||
}
|
||||
|
||||
int
|
||||
Sound_GetID(string defName)
|
||||
{
|
||||
if (defName == "")
|
||||
return -1;
|
||||
return (int)hash_get(g_hashsounds, defName, -1);
|
||||
}
|
||||
|
||||
void
|
||||
Sound_Update(entity target, int channel, int sample, float volume)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue