seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always"
seta hud_shownames_alpha 0.7 "alpha"
seta hud_shownames_resize 1 "enable resizing of the names, then the size cvars will correspond to the maximum size"
-seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
+seta hud_shownames_mindistance 1500 "start fading alpha/size at this distance"
seta hud_shownames_maxdistance 2000 "alpha/size is 0 at this distance"
// scoreboard
drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '0 0 0', a * 0.5, DRAWFLAG_NORMAL);
drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '0 0 0', a * 0.5, DRAWFLAG_NORMAL);
- drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.healthvalue/autocvar_hud_panel_healtharmor_maxhealth), vid_conwidth, myPos_y + iconsize_y);
- drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
-
- drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.armorvalue/autocvar_hud_panel_healtharmor_maxarmor), vid_conwidth, myPos_y + iconsize_y);
- drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ if(self.healthvalue > 0)
+ {
+ drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.healthvalue/autocvar_hud_panel_healtharmor_maxhealth), vid_conwidth, myPos_y + iconsize_y);
+ drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ }
+
+ if(self.armorvalue > 0)
+ {
+ drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.armorvalue/autocvar_hud_panel_healtharmor_maxarmor), vid_conwidth, myPos_y + iconsize_y);
+ drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ }
drawresetcliparea();
}
else if(autocvar_hud_shownames_status == 2 && teamplay)
setorigin(self, self.owner.origin + SHOWNAMES_ORIGIN_OFFSET);
self.SendFlags |= 1;
}
- if(self.health != floor(self.owner.health) || self.armorvalue != floor(self.owner.armorvalue))
+ if(self.health != max(0, floor(self.owner.health)) || self.armorvalue != max(0, floor(self.owner.armorvalue)))
{
- self.health = floor(self.owner.health);
- self.armorvalue = floor(self.owner.armorvalue);
+ self.health = max(0, floor(self.owner.health));
+ self.armorvalue = max(0, floor(self.owner.armorvalue));
self.SendFlags |= 2;
}
self.nextthink = time;