From 9e3fceb8a8a605c25d32c65a413197892efb7732 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 5 Oct 2021 18:38:30 +0200 Subject: [PATCH] Reduce the kill delay when round hasn't started yet to allow players to quickly rebalance teams --- qcsrc/server/clientkill.qc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/clientkill.qc b/qcsrc/server/clientkill.qc index 9b29273a6..474f15af1 100644 --- a/qcsrc/server/clientkill.qc +++ b/qcsrc/server/clientkill.qc @@ -12,6 +12,7 @@ #include #include #include +#include #include void ClientKill_Now_TeamChange(entity this) @@ -105,6 +106,9 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, - return; killtime = M_ARGV(1, float); + if(round_handler_IsActive() && !round_handler_IsRoundStarted()) + killtime = min(killtime, 1); + this.killindicator_teamchange = targetteam; // this.killindicator.count == 1 means that the kill indicator was spawned by ClientKill_Silent @@ -119,7 +123,10 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, - if (!IS_DEAD(this)) { killtime = max(killtime, this.clientkill_nexttime - time); - this.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam; + float antispam_delay = autocvar_g_balance_kill_antispam; + if(round_handler_IsActive() && !round_handler_IsRoundStarted()) + antispam_delay = min(antispam_delay, 2); + this.clientkill_nexttime = time + killtime + antispam_delay; } if (killtime <= 0 || !IS_PLAYER(this) || IS_DEAD(this)) -- 2.39.2