From: MirceaKitsune Date: Sat, 4 Sep 2010 11:25:55 +0000 (+0300) Subject: Do it in a better way. The server only sends the health of eaten players. So instead... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c80cd9213afed9403db634ecc3ab3631eb03448a;p=voretournament%2Fvoretournament.git Do it in a better way. The server only sends the health of eaten players. So instead, only show health if health is not 0, which means the predator's health is always hidden. --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 6cc7ec2a..c65579a5 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -947,7 +947,7 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num } float fieldcounter; -void Sbar_PrintStomachboardItem(vector pos, entity pl, float showhealth) +void Sbar_PrintStomachboardItem(vector pos, entity pl) { vector tmp, rgb; rgb = GetTeamRGB(pl.team); @@ -977,8 +977,8 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl, float showhealth) drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } - if(showhealth) - if(field == ST_HEALTH) { + if(field == ST_HEALTH) + if(stof(str)) { // only if player health is not 0 pos_x += 138; if(g_vore_showpreyhealth) drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); @@ -2924,13 +2924,13 @@ void Sbar_Draw (void) if(f) { - Sbar_PrintStomachboardItem(pos - '-16 124 0', pl, TRUE); + Sbar_PrintStomachboardItem(pos - '-16 124 0', pl); pos_y += 1.25 * sbar_fontsize_y; } if(getstati(STAT_STOMACH_EATEN)) if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1) - Sbar_PrintStomachboardItem(pos - '-76 156 0', pl, FALSE); + Sbar_PrintStomachboardItem(pos - '-76 156 0', pl); } if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {