From d56616c8f1886eda148cc80cc8ff6aa1d61f9e60 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 31 Jul 2011 20:46:58 +0300 Subject: [PATCH] Show minus health for prey on the stomach board --- data/qcsrc/client/Main.qc | 2 +- data/qcsrc/client/sbar.qc | 3 +-- data/qcsrc/server/g_world.qc | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index d9449353..1fe179af 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -1250,7 +1250,7 @@ void Net_ReadOtherPLReport() { float e, ph, pn; e = ReadByte(); - ph = ReadByte(); + ph = ReadShort(); // not WriteByte because we show minus health too pn = ReadByte(); if not(playerslots[e]) return; diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 4250c120..94c038e6 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -952,8 +952,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } - if(field == ST_HEALTH) - if(stof(str) > 0) { + if(field == ST_HEALTH) { pos_x += 138; if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1)) drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 13ad0071..f0022c7b 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -52,14 +52,14 @@ void OtherPLReport_Think() if(e.stat_eaten) // tempt hackers less by only sending the info of eaten players { if(cvar("g_vore_showhealth")) - WriteByte(MSG_BROADCAST, e.health); + WriteShort(MSG_BROADCAST, e.health); // not WriteByte because we show minus health too else - WriteByte(MSG_BROADCAST, 0); + WriteShort(MSG_BROADCAST, 0); WriteByte(MSG_BROADCAST, num_for_edict(e.predator)); } else { - WriteByte(MSG_BROADCAST, 0); + WriteShort(MSG_BROADCAST, 0); WriteByte(MSG_BROADCAST, 0); } self.cnt = mod(self.cnt + 1, maxclients); -- 2.39.2