mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: server: fix possible byte overflow when sending sound with attenuation == 4.0f
This commit is contained in:
@@ -2075,7 +2075,7 @@ int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample
|
||||
MSG_WriteUBitLong( msg, chan, MAX_SND_CHAN_BITS );
|
||||
|
||||
if( FBitSet( flags, SND_VOLUME )) MSG_WriteByte( msg, vol );
|
||||
if( FBitSet( flags, SND_ATTENUATION )) MSG_WriteByte( msg, attn * 64 );
|
||||
if( FBitSet( flags, SND_ATTENUATION )) MSG_WriteByte( msg, Q_min( attn * 64, 255 ));
|
||||
if( FBitSet( flags, SND_PITCH )) MSG_WriteByte( msg, pitch );
|
||||
|
||||
MSG_WriteUBitLong( msg, entityIndex, MAX_ENTITY_BITS );
|
||||
|
||||
Reference in New Issue
Block a user