X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclientkill.qc;h=474f15af1e5f4ca7da6ee0c70c942c430cdbcf34;hb=dd714ffac6b09917fcff8a0f449ea4e347e01ec0;hp=73ccb383d40fe3f2c355b325c3eb3846f15e8541;hpb=5ea8bccb50ca76ead04bde011b2f64bb6afa7286;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/clientkill.qc b/qcsrc/server/clientkill.qc index 73ccb383d..474f15af1 100644 --- a/qcsrc/server/clientkill.qc +++ b/qcsrc/server/clientkill.qc @@ -1,17 +1,19 @@ #include "clientkill.qh" -#include -#include -#include -#include - -#include "damage.qh" -#include "teamplay.qh" - -#include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include void ClientKill_Now_TeamChange(entity this) { @@ -23,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 { @@ -104,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 @@ -118,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)) @@ -129,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, ""); @@ -143,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, ""); @@ -187,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;