g_balance_kill_antispam
authorRudolf Polzer <divverent@alientrap.org>
Sat, 11 Dec 2010 19:37:43 +0000 (20:37 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 11 Dec 2010 19:37:43 +0000 (20:37 +0100)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc

index f591fe3..bd41d3f 100644 (file)
@@ -1538,7 +1538,8 @@ sv_gameplayfix_q2airaccelerate 1
 sv_gameplayfix_stepmultipletimes 1
 
 // delay for "kill" to prevent abuse
-set g_balance_kill_delay 5
+set g_balance_kill_delay 0
+set g_balance_kill_antispam 5
 
 // this feature is currently buggy in the engine (it appears to PREVENT any dropping in lots of maps, leading to weirdly aligned entities, and in some cases even CAUSES them to drop through solid, like in facing worlds nex)
 sv_gameplayfix_droptofloorstartsolid 0
index eb344da..e5ca676 100644 (file)
@@ -382,6 +382,7 @@ float autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
 float autocvar_g_balance_keyhunt_score_push;
 float autocvar_g_balance_keyhunt_throwvelocity;
 float autocvar_g_balance_kill_delay;
+float autocvar_g_balance_kill_antispam;
 float autocvar_g_balance_laser_primary_animtime;
 float autocvar_g_balance_laser_primary_damage;
 float autocvar_g_balance_laser_primary_delay;
index 0de9785..84e7a31 100644 (file)
@@ -1222,6 +1222,7 @@ Called when a client types 'kill' in the console
 =============
 */
 
+.float clientkill_nexttime;
 void ClientKill_Now_TeamChange()
 {
        if(self.killindicator_teamchange == -1)
@@ -1299,6 +1300,10 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
        if(g_race_qualifying)
                killtime = 0;
 
+       // flood control it
+       killtime = max(killtime, self.clientkill_nexttime - time);
+       self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+
        self.killindicator_teamchange = targetteam;
 
        if(!self.killindicator)
@@ -1338,10 +1343,14 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
        }
        if(self.killindicator)
        {
-               if(targetteam)
-                       self.killindicator.colormod = TeamColor(targetteam);
-               else
+               if(targetteam == 0) // just die
                        self.killindicator.colormod = '0 0 0';
+               else if(targetteam == -1) // auto
+                       self.killindicator.colormod = '0 1 0';
+               else if(targetteam == -2) // spectate
+                       self.killindicator.colormod = '0.5 0.5 0.5';
+               else
+                       self.killindicator.colormod = TeamColor(targetteam);
        }
 }