2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-28 15:45:46 +03:00

SV_EmitSound2: check player to fakeclient and active. Closes s1lentq/reapi#137

This commit is contained in:
s1lent 2019-07-31 00:01:39 +07:00
parent b4ddf0bbd3
commit 0c28b707a0
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C

View File

@ -583,12 +583,16 @@ bool EXT_FUNC SV_EmitSound2_internal(edict_t *entity, IGameClient *pReceiver, in
{
SV_Multicast(entity, origin, msg_destination | MSG_FL_BROADCAST, TRUE);
}
return true;
}
sizebuf_t *pBuffer;
client_t *receiver = pReceiver->GetClient();
if (receiver->fakeclient || (!receiver->connected && !receiver->active && !receiver->spawned))
return false;
if (bSendPAS && receiver->edict != entity) // if the sound for myself, then do not check PAS.
{
int leafnum = SV_PointLeafnum(origin);