From 8fa8508426b1bbbd5cabfcb01dfc5e3b9153185a Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 8 Feb 2016 15:31:40 +0100 Subject: [PATCH] ent_cs: proper convert health and armor values to byte before sending them (negative values were turned into positive values!) (fixes #1643 "hud shownames health/armor status indicator: health jumps to 200? when teammate dies"). --- qcsrc/common/ent_cs.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index ff67a72cd..dbadc9abb 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -16,11 +16,11 @@ { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; this.angles = v; }) \ \ PROP(false, health, \ - { WriteByte(chan, this.health / 10); /* FIXME: use a better scale? */ }, \ + { WriteByte(chan, bound(0, this.health / 10, 255)); /* FIXME: use a better scale? */ }, \ { this.healthvalue = ReadByte() * 10; }) \ \ PROP(false, armorvalue, \ - { WriteByte(chan, this.armorvalue / 10); /* FIXME: use a better scale? */ }, \ + { WriteByte(chan, bound(0, this.armorvalue / 10, 255)); /* FIXME: use a better scale? */ }, \ { this.armorvalue = ReadByte() * 10; }) \ \ PROP(true, netname, \ -- 2.39.2