Skip to content

Commit

Permalink
client index fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nairdaa authored Jan 17, 2021
1 parent a7e8f47 commit bab8f2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripting/shavit-firstjumptick.sp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int GetHUDTarget(int client)
{
int iTarget = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");

if(!IsFakeClient(iTarget))
if(!IsValidClientIndex(iTarget))
{
target = iTarget;
}
Expand Down Expand Up @@ -152,3 +152,9 @@ stock void SetCookie(int client, Handle hCookie, int n)
IntToString(n, sCookie, sizeof(sCookie));
SetClientCookie(client, hCookie, sCookie);
}

// We don't want the -1 client id bug. Thank Volvo™ for this
stock bool IsValidClientIndex(int client)
{
return (0 < client <= MaxClients);
}

0 comments on commit bab8f2c

Please sign in to comment.