Permalink
Browse files

Fix hurtshot error

  • Loading branch information...
Bara committed Jan 19, 2019
1 parent 9a6adf9 commit 4d97bed5e6d937681337b3ac882d73aa22da8766
Showing with 22 additions and 6 deletions.
  1. +22 −6 addons/sourcemod/scripting/ttt/ttt_hurtshot.sp
@@ -137,21 +137,37 @@ public Action Event_Fire(Event event, const char[] name, bool dontBroadcast)

Action OnWeaponEquip(int client, int weapon)
{
if (TTT_IsClientValid(client) && g_aListHS.FindValue(EntIndexToEntRef(weapon)) != -1)
int iRef = EntIndexToEntRef(weapon);
int iIndex = g_aListHS.FindValue(iRef);

if (iIndex != -1)
{
g_bHasHS[client] = true;
int iArrayRef = g_aListHS.Get(iIndex);

if (TTT_IsClientValid(client) && IsValidEntity(EntRefToEntIndex(iArrayRef) && iRef == iArrayRef))
{
g_bHasHS[client] = true;
}
}

return Plugin_Handled;
}

Action OnWeaponDrop(int client, int weapon)
{
if (TTT_IsClientValid(client) && g_aListHS.FindValue(EntIndexToEntRef(weapon)) != -1)
int iRef = EntIndexToEntRef(weapon);
int iIndex = g_aListHS.FindValue(iRef);

if (iIndex != -1)
{
g_bHasHS[client] = false;
int iArrayRef = g_aListHS.Get(iIndex);

if (TTT_IsClientValid(client) && IsValidEntity(EntRefToEntIndex(iArrayRef) && iRef == iArrayRef))
{
g_bHasHS[client] = false;
}
}

return Plugin_Handled;
}

0 comments on commit 4d97bed

Please sign in to comment.