]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/shownames.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / shownames.qc
index 2dbd8efa2760a437cd58bef57b9f7273a8a7b576..2fc1559494728343e27fed7b3282f2c37d668a0e 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "autocvars.qh"
 #include "miscfunctions.qh"
+#include "resources.qh"
 #include "hud/_mod.qh"
 
 #include <common/ent_cs.qh>
@@ -37,8 +38,18 @@ const float SHOWNAMES_FADESPEED = 4;
 const float SHOWNAMES_FADEDELAY = 0.4;
 void Draw_ShowNames(entity this)
 {
-       if (this.sv_entnum == (current_player + 1))  // self or spectatee
-               if (!(autocvar_hud_shownames_self && autocvar_chase_active)) return;
+       if (this.sv_entnum == current_player + 1) // self or spectatee
+       {
+               if (!autocvar_chase_active)
+                       return;
+
+               if (!autocvar_hud_shownames_self
+                       && !(spectatee_status > 0 && time <= spectatee_status_changed_time + 1))
+               {
+                       return;
+               }
+       }
+
        if (!this.sameteam && !autocvar_hud_shownames_enemies) return;
        bool hit;
        if (!autocvar_hud_shownames_crosshairdistance && this.sameteam)
@@ -117,7 +128,7 @@ void Draw_ShowNames(entity this)
                // FIXME: alpha is negative when dead, breaking death fade
                if (!this.csqcmodel_isdead) a *= f;
        }
-       if (a < ALPHA_MIN_VISIBLE && gametype != MAPINFO_TYPE_CTS) return;
+       if (a < ALPHA_MIN_VISIBLE && ISGAMETYPE(CTS)) return;
        if (vdist(this.origin - view_origin, >=, max_shot_distance)) return;
        float dist = vlen(this.origin - view_origin);
        if (autocvar_hud_shownames_maxdistance)