From: Martin Taibr Date: Tue, 6 Sep 2016 19:48:06 +0000 (+0200) Subject: damagetext: try sending 24bit ints X-Git-Tag: xonotic-v0.8.2~481^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e35a82c7d3957644617b2a95397904894cad6b00;p=xonotic%2Fxonotic-data.pk3dir.git damagetext: try sending 24bit ints --- diff --git a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc index 7134d0abc..88c5e476e 100644 --- a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc @@ -109,10 +109,10 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) { msg_entity = it; WriteHeader(MSG_ONE, damagetext); - // we need a few decimal places to avoid errors when accumulating damage + // we need to send a few decimal places to avoid errors when accumulating damage // sending them this way saves bandwidth compared to WriteCoord - WriteShort(MSG_ONE, health * 100); - WriteShort(MSG_ONE, armor * 100); + WriteInt24_t(MSG_ONE, health * 100); + WriteInt24_t(MSG_ONE, armor * 100); WriteEntity(MSG_ONE, hit); WriteCoord(MSG_ONE, location.x); @@ -128,8 +128,8 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) { #ifdef CSQC NET_HANDLE(damagetext, bool isNew) { - int health = ReadShort(); - int armor = ReadShort(); + int health = ReadInt24_t(); + int armor = ReadInt24_t(); int group = ReadShort(); vector location = vec3(ReadCoord(), ReadCoord(), ReadCoord()); int deathtype = ReadInt24_t();