]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix being able to kill your own ghost
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 12:44:51 +0000 (22:44 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 12:44:51 +0000 (22:44 +1000)
qcsrc/server/client.qc
qcsrc/server/defs.qh
qcsrc/server/player.qc

index 47bbbc5452b3f2049afa04a708a6d91d28fcdf7a..686829e3331b27eafcd16d059e3821045e0e59ea 100644 (file)
@@ -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;
index b36906c7f430a801e2df13444e700872ea96d715..fb9acbd97711ba829e45debb8215d376f1a951d8 100644 (file)
@@ -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(); }
index f2ceecf9ee4596d1cc9125da2dc7513f69f13c25..e95ae98193281c9ea5a6b1226d22b7a52548b4db 100644 (file)
@@ -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);
 }