From: Mario Date: Sun, 21 Aug 2016 12:44:51 +0000 (+1000) Subject: Fix being able to kill your own ghost X-Git-Tag: xonotic-v0.8.2~663^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9c46a925f1d4c0287b19a9be100efce8287276b0;p=xonotic%2Fxonotic-data.pk3dir.git Fix being able to kill your own ghost --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 47bbbc545..686829e33 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -934,10 +934,8 @@ 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")); - FOREACH_ENTITY_ENT(enemy, this, + IL_EACH(g_clones, it.enemy == this && !(it.effects & CSQCMODEL_EF_RESPAWNGHOST), { - if(it.classname != "body") - continue; it.killindicator = spawn(); it.killindicator.owner = it; it.killindicator.scale = 0.5; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index b36906c7f..fb9acbd97 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -451,3 +451,6 @@ STATIC_INIT(g_items) { g_items = IL_NEW(); } IntrusiveList g_initforplayer; STATIC_INIT(g_initforplayer) { g_initforplayer = IL_NEW(); } + +IntrusiveList g_clones; +STATIC_INIT(g_clones) { g_clones = IL_NEW(); } diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index f2ceecf9e..e95ae9819 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -126,6 +126,8 @@ void CopyBody(entity this, float keepvelocity) animdecide_load_if_needed(clone); animdecide_setframes(clone, false, frame, frame1time, frame2, frame2time); + IL_PUSH(g_clones, clone); + MUTATOR_CALLHOOK(CopyBody, this, clone, keepvelocity); }