From: Mario Date: Fri, 29 May 2020 07:53:35 +0000 (+1000) Subject: Make sure all the major bits are sent when updating stats X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a04ab44ecc862e25cf2296763244975925c9457b;p=xonotic%2Fxonotic-data.pk3dir.git Make sure all the major bits are sent when updating stats --- diff --git a/qcsrc/lib/stats.qh b/qcsrc/lib/stats.qh index 3727286197..39a375351b 100644 --- a/qcsrc/lib/stats.qh +++ b/qcsrc/lib/stats.qh @@ -99,7 +99,7 @@ STATIC_INIT(Stats_renumber) { FOREACH(Stats, true, it.m_id = i); } REGISTER_NET_LINKED(ENT_CLIENT_STATS) -const int Stats_groups_minor = 24; // exactly 1 byte +const int Stats_groups_minor = 24; const int Stats_groups_major = 11; // ceil(Stats_MAX / Stats_groups_minor) #define G_MAJOR(id) (floor((id) / Stats_groups_minor)) @@ -110,7 +110,7 @@ const int Stats_groups_major = 11; // ceil(Stats_MAX / Stats_groups_minor) NET_HANDLE(ENT_CLIENT_STATS, bool isnew) { make_pure(this); - const int majorBits = ReadByte(); + const int majorBits = ReadInt24_t(); for (int i = 0; i < Stats_groups_major; ++i) { if (!(majorBits & BIT(i))) { continue; @@ -151,7 +151,7 @@ void Stats_Write(entity data) statsminorBitsArr[maj] = BITSET(statsminorBitsArr[maj], BIT(G_MINOR(it.m_id)), true); } }); - WriteByte(MSG_ENTITY, majorBits); + WriteInt24_t(MSG_ENTITY, majorBits); for (int i = 0; i < Stats_groups_major; ++i) {