]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ent_cs: proper convert health and armor values to byte before sending them (negative... 282/head
authorterencehill <piuntn@gmail.com>
Mon, 8 Feb 2016 14:31:40 +0000 (15:31 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 8 Feb 2016 14:31:40 +0000 (15:31 +0100)
qcsrc/common/ent_cs.qc

index ff67a72cdc21a0c5cf398a16de87918200ea64df..dbadc9abbd6eabe1ff1a5bbd8539bd0d247577a5 100644 (file)
        { 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, \