]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reduce the kill delay when round hasn't started yet to allow players to quickly rebal...
authorterencehill <piuntn@gmail.com>
Tue, 5 Oct 2021 16:38:30 +0000 (18:38 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 5 Oct 2021 16:38:30 +0000 (18:38 +0200)
qcsrc/server/clientkill.qc

index 9b29273a65b2f65edd5c2c3830e1230a64d20c29..474f15af1e5f4ca7da6ee0c70c942c430cdbcf34 100644 (file)
@@ -12,6 +12,7 @@
 #include <server/damage.qh>
 #include <server/mutators/_mod.qh>
 #include <server/player.qh>
+#include <server/round_handler.qh>
 #include <server/teamplay.qh>
 
 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))