X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclientkill.qc;h=474f15af1e5f4ca7da6ee0c70c942c430cdbcf34;hb=dd714ffac6b09917fcff8a0f449ea4e347e01ec0;hp=ee01f7ff196433f5c2b2a5397c9bfb0d54851f6b;hpb=35a8077bd0f39b3978210196c01a1c8828c6a2c3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/clientkill.qc b/qcsrc/server/clientkill.qc index ee01f7ff1..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) @@ -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); } 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;