From: terencehill Date: Tue, 5 Oct 2021 16:38:30 +0000 (+0200) Subject: Reduce the kill delay when round hasn't started yet to allow players to quickly rebal... X-Git-Tag: xonotic-v0.8.5~329 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9e3fceb8a8a605c25d32c65a413197892efb7732;p=xonotic%2Fxonotic-data.pk3dir.git Reduce the kill delay when round hasn't started yet to allow players to quickly rebalance teams --- 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))