From: Rudolf Polzer Date: Sat, 11 Dec 2010 19:37:43 +0000 (+0100) Subject: g_balance_kill_antispam X-Git-Tag: xonotic-v0.1.0preview~58 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c0fa84804457348de3da4c864921e363da4e47b9;p=xonotic%2Fxonotic-data.pk3dir.git g_balance_kill_antispam --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index f591fe31f..bd41d3ffd 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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 diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index eb344da93..e5ca67606 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 0de9785d3..84e7a310a 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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); } }