diff --git a/src/shared/sound.h b/src/shared/sound.h index d72f1771..536972d8 100644 --- a/src/shared/sound.h +++ b/src/shared/sound.h @@ -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); diff --git a/src/shared/sound.qc b/src/shared/sound.qc index bddec284..5808423e 100644 --- a/src/shared/sound.qc +++ b/src/shared/sound.qc @@ -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) {