mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: common: fix WriteBits/ReadBits
This commit is contained in:
@@ -400,7 +400,8 @@ qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits )
|
||||
// read dwords.
|
||||
while( nBitsLeft >= 32 )
|
||||
{
|
||||
MSG_WriteUBitLong( sb, *(( uint32_t *)pOut ), 32 );
|
||||
uint32_t dword = *((uint32_t *)pOut);
|
||||
MSG_WriteUBitLong( sb, LittleLong( dword ), 32 );
|
||||
|
||||
pOut += sizeof( uint32_t );
|
||||
nBitsLeft -= 32;
|
||||
@@ -637,7 +638,8 @@ qboolean MSG_ReadBits( sizebuf_t *sb, void *pOutData, int nBits )
|
||||
// read dwords.
|
||||
while( nBitsLeft >= 32 )
|
||||
{
|
||||
*((uint32_t *)pOut) = MSG_ReadUBitLong( sb, 32 );
|
||||
uint32_t dword = MSG_ReadUBitLong( sb, 32 );
|
||||
*((uint32_t *)pOut) = LittleLong( dword );
|
||||
pOut += sizeof( uint32_t );
|
||||
nBitsLeft -= 32;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user