Permalink
Browse files

Should fix #244

  • Loading branch information...
Bara committed Dec 1, 2017
1 parent 4df205c commit 46b64d2aa6f31d2bf6af64f10d113b80c61ce696
Showing with 28 additions and 21 deletions.
  1. +11 −1 addons/sourcemod/scripting/include/ttt.inc
  2. +17 −20 addons/sourcemod/scripting/ttt/ttt_glow.sp
@@ -272,8 +272,18 @@ stock bool TTT_IsLoaded()
*/
stock bool TTT_IsClientValid(int client)
{
if (client > 0 && client <= MaxClients && IsClientInGame(client) && !IsClientSourceTV(client))
if (client > 0 && client <= MaxClients)
{
if (IsClientInGame(client))
{
return false;
}
if (!IsClientSourceTV(client))
{
return false;
}
return true;
}
return false;
@@ -283,32 +283,29 @@ public Action OnSetTransmit_GlowSkin(int skin, int client)
Call_PushCellRef(alpha);
Call_Finish();
if (TTT_IsClientValid(target))
if (seeTarget && override)
{
if (seeTarget && override)
int iSkin = EntRefToEntIndex(CPS_GetSkin(target));
if(IsValidEntity(iSkin))
{
int iSkin = EntRefToEntIndex(CPS_GetSkin(target));
int iOffset;
if(IsValidEntity(iSkin))
if ((iOffset = GetEntSendPropOffs(iSkin, "m_clrGlow")) == -1)
{
int iOffset;
if ((iOffset = GetEntSendPropOffs(iSkin, "m_clrGlow")) == -1)
{
return Plugin_Handled;
}
SetEntData(iSkin, iOffset, red, _, true);
SetEntData(iSkin, iOffset + 1, green, _, true);
SetEntData(iSkin, iOffset + 2, blue, _, true);
SetEntData(iSkin, iOffset + 3, alpha, _, true);
return Plugin_Handled;
}
SetEntData(iSkin, iOffset, red, _, true);
SetEntData(iSkin, iOffset + 1, green, _, true);
SetEntData(iSkin, iOffset + 2, blue, _, true);
SetEntData(iSkin, iOffset + 3, alpha, _, true);
}
if (seeTarget)
{
return Plugin_Continue;
}
}
if (seeTarget)
{
return Plugin_Continue;
}
return Plugin_Handled;

0 comments on commit 46b64d2

Please sign in to comment.