From: terencehill Date: Sun, 6 Nov 2016 00:24:29 +0000 (+0100) Subject: CA: fix name tags getting displayed above eliminated players (when they are spectatin... X-Git-Tag: xonotic-v0.8.2~454^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F388%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git CA: fix name tags getting displayed above eliminated players (when they are spectating or observing). It fixes #1813 --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 6a4515ac1..76125e60b 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -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); diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index 65cdd83d3..ac06dc478 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -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) {