entity porto;
vector polyline[16];
-float trace_dphitcontents;
-float trace_networkentity;
float Q3SURFACEFLAG_SLICK = 2; // low friction surface
float DPCONTENTS_SOLID = 1; // blocks player movement
float DPCONTENTS_BODY = 32; // blocks player movement
float CVAR_TYPEFLAG_READONLY = 32;
void (entity e, float chan, string samp, float vol, float atten, float pitchshift, float flags) sound7 = #8;
+
+float trace_dphitcontents;
+float trace_networkentity;
{
ent.origin_z += autocvar_hud_shownames_offset;
- if(!ent.sameteam)
- traceline(ent.origin, view_origin, 1, ent);
+ float hit;
+ if(ent.sameteam)
+ {
+ hit = 1;
+ }
+ else
+ {
+ traceline(view_origin, ent.origin, MOVE_NORMAL, ent);
+ if(trace_fraction < 1 && trace_networkentity != ent.sv_entnum)
+ hit = 0;
+ else
+ hit = 1;
+ }
vector o, eo;
o = project_3d_to_2d(ent.origin);
onscreen = (o_z >= 0 && o_x >= 0 && o_y >= 0 && o_x <= vid_conwidth && o_y <= vid_conheight);
- if(!ent.sameteam && (!onscreen || trace_endpos != view_origin)) // out of view, fade out
+ if(!ent.sameteam && (!onscreen || !hit)) // out of view, fade out
ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
else if(ent.healthvalue < 1) // dead player, fade out slowly
ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);