Skip to content

Commit

Permalink
Fix #238
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Nov 29, 2017
1 parent 12cd744 commit 5292e04
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions addons/sourcemod/scripting/ttt/ttt_decoy_body.sp
Expand Up @@ -135,18 +135,27 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count

public Action TTT_OnBodyChecked(int client, int[] ragdoll)
{
int attacker = GetClientOfUserId(ragdoll[Victim]);
bool bReal = false;
int attacker = -1;

if (!StrEqual(ragdoll[AttackerName], "Fake!", false))
{
bReal = true;
}

if (!bReal)
{
attacker = GetClientOfUserId(ragdoll[Victim]);
}
else
{
attacker = GetClientOfUserId(ragdoll[Attacker]);
}

int body = EntRefToEntIndex(ragdoll[Ent]);

if (TTT_IsClientValid(attacker) && g_bDecoyBody[attacker] && IsValidEntity(body))
{
bool bReal = false;

if (!StrEqual(ragdoll[AttackerName], "Fake!", false))
{
bReal = true;
}

if (!g_cRealBody.BoolValue && bReal)
{
return Plugin_Continue;
Expand Down

0 comments on commit 5292e04

Please sign in to comment.