Skip to content

Commit

Permalink
Merge pull request #239 from kgns/fix/chat_listener
Browse files Browse the repository at this point in the history
Fixed a rare error occurrence when client was -1 on ChatListener
  • Loading branch information
kgns authored Oct 31, 2021
2 parents 4fbdd20 + 0b0044f commit ba8d0a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addons/sourcemod/scripting/weapons/hooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ void GiveNamedItemPost(int client, const char[] classname, const CEconItemView i

public Action ChatListener(int client, const char[] command, int args)
{
if (client < 1)
{
return Plugin_Continue;
}

char msg[128];
GetCmdArgString(msg, sizeof(msg));
StripQuotes(msg);
if (StrEqual(msg, "!ws") || StrEqual(msg, "!knife") || StrEqual(msg, "!wslang") || StrContains(msg, "!nametag") == 0 || StrContains(msg, "!seed") == 0)
if (StrEqual(msg, "!ws") || StrEqual(msg, "!knife") || StrEqual(msg, "!wslang") || StrContains(msg, "!nametag") == 0 || StrContains(msg, "!seed") == 0 || StrContains(msg, "!wsreset") == 0)
{
return Plugin_Handled;
}
Expand Down

0 comments on commit ba8d0a6

Please sign in to comment.