2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-25 11:19:59 +01:00

engine: server: fix off-by-one error in Voice_Set/GetClientListening

This commit is contained in:
Alibek Omarov 2023-12-13 14:56:55 +03:00
parent 36c2f9e9f2
commit 13aab4e59c

View File

@ -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 );
@ -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 ));