diff --git a/engine/common/net_buffer.h b/engine/common/net_buffer.h index 46470d02..9b371d58 100644 --- a/engine/common/net_buffer.h +++ b/engine/common/net_buffer.h @@ -184,7 +184,8 @@ static inline void MSG_EndBitWriting( sizebuf_t *sb ) } // we have native bit ops here, just pad to closest byte - MSG_SeekToBit( sb, MSG_GetNumBytesWritten( sb ) << 3, SEEK_SET ); + if(( sb->iCurBit & 7 ) != 0 ) + MSG_SeekToBit( sb, 8 - ( sb->iCurBit & 7 ), SEEK_CUR ); } static inline void MSG_StartBitWriting( sizebuf_t *sb )