X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclientkill.qc;h=e87a2b11831c350714e352ddd436e08ade9ba6b7;hb=5604ea4b240f6ebc90f93c549df6d546a2b808d0;hp=0bb761483b19bb8433c8bf968dad5fa3679b8f19;hpb=9215008d87f1170da32befded6baeb55f3a2cf13;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/clientkill.qc b/qcsrc/server/clientkill.qc index 0bb761483..e87a2b118 100644 --- a/qcsrc/server/clientkill.qc +++ b/qcsrc/server/clientkill.qc @@ -1,13 +1,18 @@ #include "clientkill.qh" -#include - -#include "g_damage.qh" -#include "teamplay.qh" - -#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include void ClientKill_Now_TeamChange(entity this) { @@ -22,7 +27,10 @@ void ClientKill_Now_TeamChange(entity this) PutObserverInServer(this); } else - SV_ChangeTeam(this, this.killindicator_teamchange - 1); + { + Player_SetTeamIndexChecked(this, Team_TeamToIndex( + this.killindicator_teamchange)); + } this.killindicator_teamchange = 0; } @@ -122,7 +130,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, ""); @@ -134,9 +142,9 @@ void ClientKill_TeamChange(entity this, float targetteam) // 0 = don't change, - this.killindicator.count = bound(0, ceil(killtime), 10); //sprint(this, strcat("^1You'll be dead in ", ftos(this.killindicator.cnt), " seconds\n")); - IL_EACH(g_clones, it.enemy == this && !(it.effects & CSQCMODEL_EF_RESPAWNGHOST), + 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, ""); @@ -180,7 +188,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; @@ -192,8 +200,6 @@ void ClientKill_Silent(entity this, float _delay) // Called when a client types 'kill' in the console void ClientKill(entity this) { - // TODO: once .health is removed, will need to check it here for the "already dead" message! - if (game_stopped || this.player_blocked || STAT(FROZEN, this)) return;