]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/shownames.qc
Merge branch 'master' into terencehill/music_player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / shownames.qc
index c581fba428fe42ff44f203da50c94f7f612e8eb1..3c89f312b0eb4c3dd4c1634edefa97ad4a89739f 100644 (file)
@@ -22,8 +22,6 @@ void Draw_ShowNames(entity ent)
                if(!(autocvar_hud_shownames_self && autocvar_chase_active))
                        return;
 
-       makevectors(view_angles);
-
        if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies))
        {
                ent.origin_z += autocvar_hud_shownames_offset;
@@ -100,7 +98,11 @@ void Draw_ShowNames(entity ent)
                else if(time > ent.fadedelay) // fade in for enemies
                        ent.alpha = min(1, ent.alpha + SHOWNAMES_FADESPEED * frametime);
 
-               if(!ent.alpha)
+               // multiply by player alpha
+               if(!ent.sameteam || (ent.sv_entnum == player_localentnum))
+                       ent.alpha *= getplayeralpha(ent.sv_entnum-1);
+
+               if(ent.alpha < ALPHA_MIN_VISIBLE && gametype != MAPINFO_TYPE_CTS)
                        return;
 
                float dist;