Skip to content

Commit

Permalink
engine: server: fix possible byte overflow when sending sound with at…
Browse files Browse the repository at this point in the history
…tenuation == 4.0f
  • Loading branch information
a1batross committed Jul 6, 2024
1 parent 080eba9 commit 457422c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/server/sv_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 457422c

Please sign in to comment.