Skip to content

Commit

Permalink
engine: server: fix off-by-one error in Voice_Set/GetClientListening
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Dec 13, 2023
1 parent 36c2f9e commit 13aab4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/server/sv_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -4525,7 +4525,7 @@ static qboolean GAME_EXPORT pfnVoice_GetClientListening( int iReceiver, int iSen
iReceiver -= 1;
iSender -= 1;

if( iReceiver < 0 || iReceiver >= svs.maxclients || iSender < 0 || iSender > svs.maxclients )
if( iReceiver < 0 || iReceiver >= svs.maxclients || iSender < 0 || iSender >= svs.maxclients )
return false;

return (FBitSet( svs.clients[iSender].listeners, BIT( iReceiver )) != 0 );
Expand All @@ -4542,7 +4542,7 @@ static qboolean GAME_EXPORT pfnVoice_SetClientListening( int iReceiver, int iSen
iReceiver -= 1;
iSender -= 1;

if( iReceiver < 0 || iReceiver >= svs.maxclients || iSender < 0 || iSender > svs.maxclients )
if( iReceiver < 0 || iReceiver >= svs.maxclients || iSender < 0 || iSender >= svs.maxclients )
return false;

if( bListen ) SetBits( svs.clients[iSender].listeners, BIT( iReceiver ));
Expand Down

0 comments on commit 13aab4e

Please sign in to comment.