// self.origin = player origin TODO: should maybe move this so it's the origin of the shownames tag already in SSQC for culling?
// self.healthvalue
// self.armorvalue
+// self.eaten
// self.sameteam = player is on same team as local client
//
const float SHOWNAMES_FADESPEED = 4;
if(ent.sv_entnum == player_localentnum && !cvar("chase_active"))
return;
+ if(ent.predator) // don't show names for prey
+ return;
+
if(ent.sameteam || (!ent.sameteam && cvar("hud_shownames_enemies")))
{
ent.origin_z += cvar("hud_shownames_offset");
+ // offset the name by player scale, decided by health
+ if(g_healthsize)
+ ent.origin_z -= (g_healthsize - ent.healthvalue) * cvar("hud_shownames_offset_healthsize");
+
if(!ent.sameteam)
{
/* WIP, why does trace_ent != ent not work as intended here?
e.healthvalue = entcs.healthvalue;
e.armorvalue = entcs.armorvalue;
e.sameteam = 1; /* (teamplay && (t == myteam)); */
+ e.predator = entcs.predator;
}
else
{
e.healthvalue = 2342;
e.armorvalue = 0;
e.sameteam = 0;
+ e.predator = 0;
}
e.origin = getplayerorigin(i);