X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fshownames.qc;h=3bc231c254ffa4991b6d59acd73286880a952aeb;hb=707b95ea2f5399ce787bc7a1087d211bd851d4ff;hp=d5e24888d34a79e03d2de8db4a8c19ca22c8219f;hpb=69ce389c2d8428de35bc392b7aa38b121632ca6c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index d5e24888d..3bc231c25 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -5,7 +5,8 @@ // self.sameteam = player is on same team as local client // self.fadedelay = time to wait before name tag starts fading in for enemies // self.pointtime = last time you pointed at this player -// +// self.csqcmodel_isdead = value of csqcmodel_isdead to know when the player is dead or not + const float SHOWNAMES_FADESPEED = 4; const float SHOWNAMES_FADEDELAY = 0.4; void Draw_ShowNames(entity ent) @@ -35,14 +36,14 @@ void Draw_ShowNames(entity ent) else { traceline(view_origin, ent.origin, MOVE_NORMAL, ent); - if(trace_fraction < 1 && trace_networkentity != ent.sv_entnum) + if(trace_fraction < 1 && (trace_networkentity != ent.sv_entnum && trace_ent.entnum != ent.sv_entnum)) hit = 0; else hit = 1; } // handle tag fading - float overlap, onscreen, crosshairdistance; + float overlap = FALSE, onscreen, crosshairdistance; vector o, eo; o = project_3d_to_2d(ent.origin); @@ -90,7 +91,7 @@ void Draw_ShowNames(entity ent) ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); ent.fadedelay = 0; // reset fade in delay, enemy has left the view } - else if(ent.healthvalue < 1) // dead player, fade out slowly + else if(ent.csqcmodel_isdead) // dead player, fade out slowly ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime); else if(overlap) // tag overlap detected, fade out ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); @@ -186,7 +187,7 @@ void Draw_ShowNames_All() { float t; t = GetPlayerColor(i); - if(t == COLOR_SPECTATOR) + if(t == FL_SPECTATOR) continue; entity e; @@ -214,9 +215,11 @@ void Draw_ShowNames_All() e.sameteam = 0; } - e.origin = getplayerorigin(i); + setorigin(e, getplayerorigin(i)); if(e.origin == GETPLAYERORIGIN_ERROR) continue; + + e.csqcmodel_isdead = getplayerisdead(i); Draw_ShowNames(e); }