]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_player.qc
Don't cut prey sound volume when that prey is either yourself, either someone in...
[voretournament/voretournament.git] / data / qcsrc / server / cl_player.qc
index 14a35473f9fadbb6fa7c81a960f4febdabb914f7..e7bfb2d488a6d177fb1ba5452879d08bc66d2a72 100644 (file)
@@ -1225,7 +1225,7 @@ void GlobalSound(string sample, float chan, float voicetype)
 {\r
        float n;\r
        float tauntrand;\r
-       float vol;\r
+       float vol, vol_apply;\r
 \r
        if(sample == "")\r
                return;\r
@@ -1255,7 +1255,10 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
+                                               {\r
+                                                       vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+                                               }\r
                                                else\r
                                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                        }\r
@@ -1269,7 +1272,10 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
+                                               {\r
+                                                       vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+                                               }\r
                                                else\r
                                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                        }\r
@@ -1283,7 +1289,10 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if(!teams_matter || msg_entity.team == self.team)\r
                                {\r
                                        if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                               soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
+                                       {\r
+                                               vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                                               soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+                                       }\r
                                        else\r
                                                soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                }\r
@@ -1300,7 +1309,10 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
                                {\r
                                        if (msg_entity.cvar_cl_voice_directional >= 1)\r
-                                               soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                                       {\r
+                                               vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                                               soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                                       }\r
                                        else\r
                                                soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                }\r
@@ -1316,12 +1328,19 @@ void GlobalSound(string sample, float chan, float voicetype)
                        FOR_EACH_REALCLIENT(msg_entity)\r
                        {\r
                                if (msg_entity.cvar_cl_voice_directional >= 1)\r
-                                       soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                               {\r
+                                       vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                                       soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                               }\r
                                else\r
                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                        }\r
                case VOICETYPE_PLAYERSOUND:\r
-                               sound(self, chan, sample, vol, ATTN_NORM);\r
+                       FOR_EACH_REALCLIENT(msg_entity)\r
+                       {\r
+                               vol_apply = (self.predator != msg_entity.predator && self != msg_entity) ? vol : VOL_BASEVOICE;\r
+                               soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_NORM);\r
+                       }\r
                        break;\r
                case VOICETYPE_GURGLE:\r
                        if(self.stomach_load)\r