From 8923c486590cf3fa7096d0a6323fdd962e83c6ed Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 6 Nov 2016 01:24:29 +0100 Subject: [PATCH] CA: fix name tags getting displayed above eliminated players (when they are spectating or observing). It fixes #1813 --- qcsrc/client/shownames.qc | 2 ++ qcsrc/common/ent_cs.qh | 11 +++++++++++ 2 files changed, 13 insertions(+) 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) { -- 2.39.2