]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/clientkill.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / clientkill.qc
index 96adde60f3d70baa5cca7ebd79b3831f78662743..296a95bfe5f384c9d8428626f0a1cbd0282fff2f 100644 (file)
@@ -1,18 +1,19 @@
 #include "clientkill.qh"
 
-#include <common/weapons/_all.qh>
-#include <common/stats.qh>
-#include <server/client.qh>
-#include <server/player.qh>
-#include <server/mutators/_mod.qh>
-
-#include "damage.qh"
-#include "teamplay.qh"
-
-#include <common/vehicles/sv_vehicles.qh>
+#include <common/csqcmodel_settings.qh>
+#include <common/deathtypes/all.qh>
 #include <common/mapobjects/triggers.qh>
 #include <common/notifications/all.qh>
 #include <common/stats.qh>
+#include <common/stats.qh>
+#include <common/vehicles/sv_vehicles.qh>
+#include <common/weapons/_all.qh>
+#include <server/client.qh>
+#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)
 {
@@ -24,7 +25,7 @@ void ClientKill_Now_TeamChange(entity this)
        {
                if (blockSpectators)
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
-               PutObserverInServer(this);
+               PutObserverInServer(this, false, true);
        }
        else
        {
@@ -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))
@@ -130,7 +137,7 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, -
                {
                        float starttime = max(time, clientkilltime);
 
-                       this.killindicator = spawn();
+                       this.killindicator = new(killindicator);
                        this.killindicator.owner = this;
                        this.killindicator.scale = 0.5;
                        setattachment(this.killindicator, this, "");
@@ -144,7 +151,7 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, -
 
                        IL_EACH(g_clones, it.enemy == this && !(it.effects & CSQCMODEL_EF_RESPAWNGHOST) && !it.killindicator,
                        {
-                               it.killindicator = spawn();
+                               it.killindicator = new(killindicator);
                                it.killindicator.owner = it;
                                it.killindicator.scale = 0.5;
                                setattachment(it.killindicator, it, "");
@@ -188,7 +195,7 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, -
 
 void ClientKill_Silent(entity this, float _delay)
 {
-       this.killindicator = spawn();
+       this.killindicator = new(killindicator);
        this.killindicator.owner = this;
        setthink(this.killindicator, KillIndicator_Think);
        this.killindicator.nextthink = time + (this.lip) * 0.05;