From 0c28b707a05ccace447f5d9b9406469c9487e9ea Mon Sep 17 00:00:00 2001 From: s1lent Date: Wed, 31 Jul 2019 00:01:39 +0700 Subject: [PATCH] SV_EmitSound2: check player to fakeclient and active. Closes s1lentq/reapi#137 --- rehlds/rehlds/rehlds_api_impl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 9af51bd..95076f2 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -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);