From 5e7a29ea95b1b4f700032f80dfeb0252bb38bbd3 Mon Sep 17 00:00:00 2001 From: hubdom <26039831+hubdom@users.noreply.github.com> Date: Thu, 24 Dec 2020 16:05:15 +0100 Subject: [PATCH] StopSound: fix minor bug --- StopSound/scripting/StopSound.sp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StopSound/scripting/StopSound.sp b/StopSound/scripting/StopSound.sp index f6507d5d..9f4eba16 100644 --- a/StopSound/scripting/StopSound.sp +++ b/StopSound/scripting/StopSound.sp @@ -518,8 +518,8 @@ public Action Hook_NormalSound_CSS(int clients[MAXPLAYERS], int &numClients, cha return Plugin_Continue; } - int owner = entity; - if(owner > MaxClients) + int owner = -1; + if(entity > MaxClients) { char sClassname[64]; if(GetEntityClassname(entity, sClassname, sizeof(sClassname))) @@ -534,7 +534,7 @@ public Action Hook_NormalSound_CSS(int clients[MAXPLAYERS], int &numClients, cha for(int i = 0; i < numClients; i++) { int client = clients[i]; - if(owner == client || (!g_bStopWeaponSounds[client] && IsClientInGame(client))) + if(owner == client || (!g_bStopWeaponSounds[client])) { // Keep client. clients[j] = clients[i];