From: MirceaKitsune Date: Thu, 1 Mar 2012 11:38:41 +0000 (+0200) Subject: Fix and improve my last tweaks X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=046ed74e3faa5e5931238ed79a92fbd1ff7995aa;p=voretournament%2Fvoretournament.git Fix and improve my last tweaks --- diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index c8e9681f..f7cae1c6 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1240,10 +1240,9 @@ void GlobalSound(string sample, float chan, float voicetype) // modified volume, used for attenuated (non-radio) voices vol_scale = vol_prey = 1; if(cvar("g_healthsize") && cvar("g_healthsize_soundfactor")) // amplify or reduce sound volume based on the size of the player - vol_scale *= pow(self.scale, cvar("g_healthsize_soundfactor")); + vol_scale *= bound(0, pow(self.scale, cvar("g_healthsize_soundfactor")), 1); if(self.stat_eaten && cvar("g_vore_soundocclusion")) // reduce sound volume for prey, to simulate stomach culling - vol_prey *= cvar("g_vore_soundocclusion"); - vol = bound(0, vol, 1); + vol_prey *= bound(0, cvar("g_vore_soundocclusion"), 1); switch(voicetype) { @@ -1256,7 +1255,8 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); } else @@ -1273,7 +1273,8 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); } else @@ -1290,7 +1291,8 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); } else @@ -1310,7 +1312,8 @@ void GlobalSound(string sample, float chan, float voicetype) { if (msg_entity.cvar_cl_voice_directional >= 1) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); } else @@ -1329,7 +1332,8 @@ void GlobalSound(string sample, float chan, float voicetype) { if (msg_entity.cvar_cl_voice_directional >= 1) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); } else @@ -1338,13 +1342,15 @@ void GlobalSound(string sample, float chan, float voicetype) case VOICETYPE_PLAYERSOUND: FOR_EACH_REALCLIENT(msg_entity) { - vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? VOL_BASEVOICE * vol_scale * vol_prey : VOL_BASEVOICE * vol_scale; + vol_apply = VOL_BASEVOICE; + vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale; soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_NORM); } break; case VOICETYPE_GURGLE: + // since players can't be prey and predators at the same time, we don't use the prey modifier for the gurgle sound volume if(self.stomach_load) - sound(self, chan, sample, bound(0, vol * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM); + sound(self, chan, sample, bound(0, vol_scale * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM); else stopsound(self, chan); break;