Make the vore taunt play-rate server side. There's simply no way to make it a client...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 01:25:44 +0000 (03:25 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 01:25:44 +0000 (03:25 +0200)
data/defaultVoretournament.cfg
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_damage.qc
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/vore.qc

index 05a3727..7ab61ca 100644 (file)
@@ -207,7 +207,7 @@ cl_autodemo_nameformat demos/%Y-%m-%d_%H-%M
 \r
 // taunts and voices\r
 seta cl_autotaunt 0.75 "automatically taunt enemies when fragging them"\r
-seta cl_autotaunt_repeat 5 "how many seconds to attempt playing repeatable taunts"\r
+seta sv_vore_autotaunt_repeat 5 "how many seconds to attempt playing voew taunts"\r
 seta sv_taunt 1 "allow taunts on the server"\r
 seta sv_autotaunt 1 "allow autotaunts on the server"\r
 seta cl_voice_directional 1    "0 = all voices are non-directional, 1 = all voices are directional, 2 = only taunts are directional"\r
index 2cbfbd2..b5f1333 100644 (file)
@@ -2651,7 +2651,6 @@ void PlayerPreThink (void)
                }\r
 \r
                self.taunt_soundtime = 0;\r
-               self.taunt_soundtimefiltered = FALSE;\r
                self.taunt_soundtype = 0;\r
        }\r
 \r
index ea3a979..bef0ec6 100644 (file)
@@ -1211,8 +1211,6 @@ void UpdatePlayerSounds()
        LoadPlayerSounds(strcat(self.model, ".sounds"), 0);\r
 }\r
 \r
-.float soundtimefilter;\r
-.entity soundownerfilter;\r
 void GlobalSound(string sample, float chan, float voicetype)\r
 {\r
        float n;\r
@@ -1296,23 +1294,16 @@ void GlobalSound(string sample, float chan, float voicetype)
                        tauntrand = random();\r
                        FOR_EACH_REALCLIENT(msg_entity)\r
                        {\r
-                               msg_entity.soundownerfilter = self;\r
                                if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
-                               if not (self.taunt_soundtimefiltered && msg_entity.soundownerfilter.soundtimefilter > time)\r
+                               if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                {\r
-                                       if (msg_entity.cvar_cl_voice_directional >= 1)\r
-                                       {\r
-                                               if(self.predator.classname == "player")\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
-                                               else\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
-                                       }\r
+                                       if(self.predator.classname == "player")\r
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
                                        else\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
-\r
-                                       if(self.taunt_soundtimefiltered)\r
-                                               msg_entity.soundownerfilter.soundtimefilter = time + msg_entity.cvar_cl_autotaunt_repeat;\r
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, 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
                        break;\r
                case VOICETYPE_TAUNT:\r
index a263606..b014357 100644 (file)
@@ -519,7 +519,6 @@ void VoiceMessage(string type, string message);
 \r
 // autotaunt system\r
 .float cvar_cl_autotaunt;\r
-.float cvar_cl_autotaunt_repeat;\r
 .float cvar_cl_voice_directional;\r
 .float cvar_cl_voice_directional_taunt_attenuation;\r
 \r
index 8514033..483ff0c 100644 (file)
@@ -58,13 +58,11 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u
 .entity pusher;\r
 \r
 .float taunt_soundtime;\r
-.float taunt_soundtimefiltered;\r
 .float taunt_soundtype;\r
 \r
-void SetAutoTaunt(entity e, float t_soundtime, float t_soundtimefiltered, float soundtype)\r
+void SetAutoTaunt(entity e, float t_soundtime, float soundtype)\r
 {\r
        e.taunt_soundtime = t_soundtime;\r
-       e.taunt_soundtimefiltered = t_soundtimefiltered;\r
        e.taunt_soundtype = soundtype;\r
 }\r
 \r
@@ -382,7 +380,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You ate ^7", s, GetAdvancedDeathReports(targ)));\r
                                                        centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were eaten by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                }\r
-                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
+                                               SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
                                else\r
@@ -398,7 +396,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You killed ^7", s, GetAdvancedDeathReports(targ)));\r
                                                        centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were killed by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                }\r
-                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
+                                               SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
 \r
index 348d3f2..ea84cac 100644 (file)
@@ -608,7 +608,6 @@ void GetCvars(float f)
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);\r
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);\r
        GetCvars_handleFloat(s, f, cvar_cl_autotaunt, "cl_autotaunt");\r
-       GetCvars_handleFloat(s, f, cvar_cl_autotaunt_repeat, "cl_autotaunt_repeat");\r
        GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag");\r
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional");\r
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");\r
index 29f8dbb..e9a3591 100644 (file)
@@ -421,12 +421,12 @@ void Vore_AutoTaunt()
                if(self.stomach_load && !Stomach_TeamMates_check(self))\r
                {\r
                        if(!self.taunt_soundtime)\r
-                               SetAutoTaunt(self, time, TRUE, TAUNTTYPE_VOREPRED);\r
+                               SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPRED);\r
                }\r
                else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED)\r
                {\r
                        // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it\r
-                       SetAutoTaunt(self, 0, FALSE, 0);\r
+                       SetAutoTaunt(self, 0, 0);\r
                }\r
        }\r
        else\r
@@ -435,12 +435,12 @@ void Vore_AutoTaunt()
                if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team))\r
                {\r
                        if(!self.taunt_soundtime)\r
-                               SetAutoTaunt(self, time, TRUE, TAUNTTYPE_VOREPREY);\r
+                               SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPREY);\r
                }\r
                else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY)\r
                {\r
                        // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it\r
-                       SetAutoTaunt(self, 0, FALSE, 0);\r
+                       SetAutoTaunt(self, 0, 0);\r
                }\r
        }\r
 }\r