From: MirceaKitsune Date: Sat, 26 Feb 2011 16:32:43 +0000 (+0200) Subject: Improve the cutsound code. Unfortunately, as long as the cutsound feature is enabled... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9465413bdc066d7d5cca67de136f30c74c7cb587;p=voretournament%2Fvoretournament.git Improve the cutsound code. Unfortunately, as long as the cutsound feature is enabled, you won't be able to configure your volume while inside the stomach. --- diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 0e4167c8..f7a268e1 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -699,7 +699,12 @@ void CSQC_UpdateView(float w, float h) if(cvar("cl_vore_cutvolume_sound") < 1 || cvar("cl_vore_cutvolume_music") < 1) { float volume_modify_1_target, volume_modify_2_target, volume_modify_fade; - if(getstati(STAT_VORE_EATEN)) + if(spectatee_status == -1 || intermission) + { + volume_modify_1_target = 1; + volume_modify_2_target = 1; + } + else if(getstati(STAT_VORE_EATEN)) { volume_modify_1_target = volume_modify_default_1 * cvar("cl_vore_cutvolume_sound"); volume_modify_2_target = volume_modify_default_2 * cvar("cl_vore_cutvolume_music"); @@ -711,13 +716,7 @@ void CSQC_UpdateView(float w, float h) } volume_modify_fade = cvar("cl_vore_cutvolume_fade") * frametime; - if(spectatee_status == -1 || intermission) - { - // no volume fading is currently taking place, so if we change the volume settings, update the initial volume - volume_modify_default_1 = cvar("volume"); - volume_modify_default_2 = cvar("bgmvolume"); - } - else if(volume_modify_1 != volume_modify_1_target || volume_modify_2 != volume_modify_2_target) + if(volume_modify_1 != volume_modify_1_target || volume_modify_2 != volume_modify_2_target) { if (volume_modify_1 > volume_modify_1_target + volume_modify_fade) volume_modify_1 -= volume_modify_fade; @@ -737,9 +736,10 @@ void CSQC_UpdateView(float w, float h) cvar_set("bgmvolume", ftos(volume_modify_2)); // TODO: Setting the "volume" cvar is a bad way to go, and modifies the menu slider! We need a better way } - else if(cvar("volume") != volume_modify_default_1 || cvar("bgmvolume") != volume_modify_default_2) + else if not(getstati(STAT_VORE_EATEN)) { - // no volume fading is currently taking place, so if we change the volume settings, update the initial volume + // no volume fading is currently taking place, and we are not inside the stomach. + // so if we change the volume settings, update the initial volume volume_modify_default_1 = cvar("volume"); volume_modify_default_2 = cvar("bgmvolume"); }