delay taunts by 1 second
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 8 Jan 2009 09:00:07 +0000 (09:00 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 8 Jan 2009 09:00:07 +0000 (09:00 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5449 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/g_damage.qc

index d3a235e..c1bbbb5 100644 (file)
@@ -2299,12 +2299,19 @@ void PlayerPreThink (void)
                oldself = self; self = self.teamkill_soundsource;
                oldpusher = self.pusher; self.pusher = oldself;
 
-               VoiceMessage("teamshoot_auto");
+               PlayerSound(playersound_teamshoot, CHAN_VOICE, 3);
 
                self.pusher = oldpusher;
                self = oldself;
        }
 
+       if(self.taunt_soundtime)
+       if(time > self.taunt_soundtime)
+       {
+               self.taunt_soundtime = 0;
+               PlayerSound(playersound_taunt, CHAN_VOICE, 4);
+       }
+
        target_voicescript_next(self);
 }
 
index 4750950..b7ef19e 100644 (file)
@@ -765,8 +765,6 @@ float GetVoiceMessageTeamsayType(string type)
                return 0;
        if(type == "teamshoot")
                return 2;
-       if(type == "teamshoot_auto")
-               return 3;
        return 1;
 }
 
@@ -782,8 +780,6 @@ float GetPlayerSoundSampleField_fixed;
 #define _VOICEMSG(m) case #m: return playersound_##m;
                ALLVOICEMSGS
 #undef _VOICEMSG
-               // exception:
-               case "teamshoot_auto": return playersound_teamshoot;
        }
        GetPlayerSoundSampleField_notFound = 1;
        return playersound_taunt;
index 2839d23..d734c0d 100644 (file)
@@ -11,6 +11,7 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u
 .float teamkill_soundtime;
 .entity teamkill_soundsource;
 .entity pusher;
+.float taunt_soundtime;
 
 
 float IsDifferentTeam(entity a, entity b)
@@ -296,10 +297,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                } else {
                                        centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
                                        centerprint(targ, strcat("^1You were fragged by ^7", a, "\n\n\n"));
-                                       entity oldself = self; // Hackish way to fix taunts, otherwise they play the other way around
-                                       self = attacker;
-                                       PlayerSound(playersound_taunt, CHAN_VOICE, 4);
-                                       self = oldself;
+                                       attacker.taunt_soundtime = time + 1;
                                }
 
                                if(sv_gentle) {