From: terencehill Date: Mon, 8 Feb 2016 14:31:40 +0000 (+0100) Subject: ent_cs: proper convert health and armor values to byte before sending them (negative... X-Git-Tag: xonotic-v0.8.2~1193^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8fa8508426b1bbbd5cabfcb01dfc5e3b9153185a;p=xonotic%2Fxonotic-data.pk3dir.git 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"). --- 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, \