From: MirceaKitsune Date: Sat, 3 Mar 2012 13:32:38 +0000 (+0200) Subject: Allow setting the volume of a global sound X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5031c3d8d390fd196f478fbea744545121460c83;p=voretournament%2Fvoretournament.git Allow setting the volume of a global sound --- diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index e595c69a..69bd25db 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -868,12 +868,12 @@ void SV_PlayerPhysics() { if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) { - GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', 1); } else { - GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', 1); } } diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index f7cae1c6..7f22f580 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1221,7 +1221,7 @@ void UpdatePlayerSounds() LoadPlayerSounds(strcat(self.model, ".sounds"), 0); } -void GlobalSound(string sample, float chan, float voicetype) +void GlobalSound(string sample, float chan, float voicetype, float vol) { float n; float tauntrand; @@ -1368,7 +1368,7 @@ void PlayerSound(entity player, .string samplefield, float chan, float voicetype oldself = self; self = player; sample = self.samplefield; - GlobalSound(sample, chan, voicetype); + GlobalSound(sample, chan, voicetype, VOL_BASEVOICE); self = oldself; } diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 55cdcae9..6871a584 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -518,7 +518,7 @@ void PrecacheGlobalSound(string samplestring); void UpdatePlayerSounds(); void ClearPlayerSounds(); void PlayerSound(entity player, .string samplefield, float channel, float voicetype); -void GlobalSound(string samplestring, float channel, float voicetype); +void GlobalSound(string samplestring, float channel, float voicetype, float vol); void VoiceMessage(string type, string message); // autotaunt system diff --git a/data/qcsrc/server/sv_main.qc b/data/qcsrc/server/sv_main.qc index 52aca6a1..310fd446 100644 --- a/data/qcsrc/server/sv_main.qc +++ b/data/qcsrc/server/sv_main.qc @@ -107,9 +107,9 @@ void CreatureFrame (void) if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS) { if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) - GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); else - GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); sound(self, CHAN_AUTO, "misc/macro_footstep.wav", VOL_BASE, ATTN_NORM); } diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 87baed61..5dca344b 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -139,7 +139,7 @@ void Vore_GurgleSound() { if(time > self.gurglesound_finished || (self.gurgle_oldstomachload != self.stomach_load && !self.digesting)) { - GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE); + GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE, VOL_BASE); self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do? self.gurgle_oldstomachload = self.stomach_load;