From: MirceaKitsune Date: Thu, 1 Mar 2012 11:17:44 +0000 (+0200) Subject: Don't cut prey sound volume when that prey is either yourself, either someone in... X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=021daa8f4356262c2bb2e8563f192dce53691c7f;p=voretournament%2Fvoretournament.git Don't cut prey sound volume when that prey is either yourself, either someone in the same belly as you. So you only hear prey at lesser volume when you are outside and they're not --- diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 14a35473..e7bfb2d4 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1225,7 +1225,7 @@ void GlobalSound(string sample, float chan, float voicetype) { float n; float tauntrand; - float vol; + float vol, vol_apply; if(sample == "") return; @@ -1255,7 +1255,10 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1269,7 +1272,10 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1283,7 +1289,10 @@ void GlobalSound(string sample, float chan, float voicetype) if(!teams_matter || msg_entity.team == self.team) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1300,7 +1309,10 @@ void GlobalSound(string sample, float chan, float voicetype) if (tauntrand < msg_entity.cvar_cl_autotaunt) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1316,12 +1328,19 @@ void GlobalSound(string sample, float chan, float voicetype) FOR_EACH_REALCLIENT(msg_entity) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } case VOICETYPE_PLAYERSOUND: - sound(self, chan, sample, vol, ATTN_NORM); + FOR_EACH_REALCLIENT(msg_entity) + { + vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE; + soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_NORM); + } break; case VOICETYPE_GURGLE: if(self.stomach_load) diff --git a/docs/TODO.txt b/docs/TODO.txt index e0533763..8a7a067b 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -126,6 +126,6 @@ - 0.7 BUG: Fix the following crash, apparently taking place after the tutorial map: http://pastebin.com/hz9md090 -- 0.7: When a player sound has less volume because the player is in a belly, make sure that doesn't apply to neighboring prey, because they are there too +- 0.7: I set a different horizontal and vertical view bobbing, but the menu sliders adjust both to the same value. Fix this somehow -- 0.7: I set a different horizontal and vertical view bobbing, but the menu sliders adjust both to the same value. Fix this somehow \ No newline at end of file +- 0.7 BUG: Death chase camera activates when you're in a belly \ No newline at end of file