Send -1 soundscapeIndex's & cl_soundscape_flush (helps with kz_bhop_genkai) (#12)

This commit is contained in:
rtldg 2025-01-28 07:19:46 +00:00 committed by GitHub
parent 2fb7a1d9d7
commit 58a1046e0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ public Plugin myinfo =
name = "Sound Manager",
author = "Haze",
description = "",
version = "1.0.3",
version = "1.0.4",
url = ""
}
@ -159,6 +159,11 @@ public void OnClientCookiesCached(int client)
{
gB_ShouldHookShotgunShot = true;
}
if(gI_Settings[client] & Mute_Soundscapes)
{
ClientCommand(client, "cl_soundscape_flush"); // maybe auth can take a long time and a soundscape slips through...
}
}
public Action OnPlayerRunCmd(int client)
@ -308,10 +313,12 @@ struct ss_update_t
//void CEnvSoundscape::UpdateForPlayer( ss_update_t &update )
public MRESReturn DHook_UpdateForPlayer(int pThis, Handle hParams)
{
#if 0
if(gI_SilentSoundScape == -1)
{
return MRES_Ignored;
}
#endif
int client = DHookGetParamObjectPtrVar(hParams, 1, 0, ObjectValueType_CBaseEntityPtr);
@ -588,6 +595,13 @@ public int MenuHandler_Sounds(Menu menu, MenuAction action, int param1, int para
{
CheckShotgunShotHook();
}
else if(iOption == Mute_Soundscapes)
{
if(gI_Settings[param1] & Mute_Soundscapes)
{
ClientCommand(param1, "cl_soundscape_flush");
}
}
char sCookie[16];
IntToString(gI_Settings[param1], sCookie, 16);