]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CA: fix name tags getting displayed above eliminated players (when they are spectatin... 388/head
authorterencehill <piuntn@gmail.com>
Sun, 6 Nov 2016 00:24:29 +0000 (01:24 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 6 Nov 2016 18:36:20 +0000 (19:36 +0100)
qcsrc/client/shownames.qc
qcsrc/common/ent_cs.qh

index 6a4515ac14f128f4b20eba195a090b849a0a138c..76125e60b7e1a63224935ea7db8b22cf4b4e207e 100644 (file)
@@ -193,6 +193,8 @@ void Draw_ShowNames_All()
                        it.sameteam = false;
                }
                bool dead = entcs_IsDead(i) || entcs_IsSpectating(i);
+               if(gametype == MAPINFO_TYPE_CA)
+                       dead = (dead || entcs_IsEliminated(i));
                if (!it.csqcmodel_isdead) setorigin(it, entcs.origin);
                it.csqcmodel_isdead = dead;
                Draw_ShowNames(it);
index 65cdd83d3a71f4f5df325a8e90b727d936cb1300..ac06dc4788ff0eb0d403075c1a747dba8a62e105 100644 (file)
@@ -68,6 +68,17 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
 
        /**
      * @param i zero indexed player
+     */
+    .int frags;
+       bool entcs_IsEliminated(int i)
+       {
+               bool unconnected = !playerslots[i].gotscores;
+               entity e = entcs_receiver(i);
+               return unconnected || ((e) ? e.frags : stof(getplayerkeyvalue(i, "frags"))) == FRAGS_LMS_LOSER;
+       }
+
+       /**
+     * @param i zero indexed player
      */
        int entcs_GetClientColors(int i)
        {