Core/PacketIO: Fixed writing exactly 32 bits

This commit is contained in:
Shauren
2024-12-20 17:27:18 +01:00
parent a2371c8467
commit aa3a62e518

View File

@@ -197,7 +197,7 @@ class TC_SHARED_API ByteBuffer
void WriteBits(uint64 value, int32 bits)
{
// remove bits that don't fit
value &= (1 << bits) - 1;
value &= (UI64LIT(1) << bits) - 1;
if (bits > int32(_bitpos))
{
@@ -216,7 +216,7 @@ class TC_SHARED_API ByteBuffer
// store remaining bits in the bit buffer
_bitpos = 8 - bits;
_curbitval = (value & ((1 << bits) - 1)) << _bitpos;
_curbitval = (value & ((UI64LIT(1) << bits) - 1)) << _bitpos;
}
else
{