From: Samual Lenks Date: Sun, 29 Dec 2013 09:14:32 +0000 (-0500) Subject: Multiply shownames alpha by player alpha X-Git-Tag: xonotic-v0.8.0~249^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c92b95f51c39fa3ef309e1c2e4c63685aefd048;p=xonotic%2Fxonotic-data.pk3dir.git Multiply shownames alpha by player alpha --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index c035da1b2..413eaaf54 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -9,7 +9,6 @@ const float SHOWNAMES_FADESPEED = 4; const float SHOWNAMES_FADEDELAY = 0.4; -const float SHOWNAMES_MIN_ALPHA = 0.5; void Draw_ShowNames(entity ent) { if(!autocvar_hud_shownames) @@ -25,7 +24,6 @@ void Draw_ShowNames(entity ent) makevectors(view_angles); - if(ent.sameteam || (getplayeralpha(ent.sv_entnum-1) >= SHOWNAMES_MIN_ALPHA)) if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies)) { ent.origin_z += autocvar_hud_shownames_offset; @@ -102,7 +100,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) return; float dist;