Skip to content

Commit

Permalink
Attempt to fix sm_hosties_lr_damage
Browse files Browse the repository at this point in the history
  • Loading branch information
azalty committed Jul 10, 2023
1 parent 35ca66d commit 087a979
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions addons/sourcemod/scripting/hosties/lastrequest.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2115,26 +2115,25 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
}
default:
{
if ((attacker == LR_Player_Guard && victim != LR_Player_Prisoner) || (attacker == LR_Player_Prisoner && victim != LR_Player_Guard) && type != LR_Rebel && (GetClientTeam(attacker) != GetClientTeam(victim)))
{
damage = 0.0;
return Plugin_Changed;
}
else if ((victim == LR_Player_Prisoner && attacker == LR_Player_Guard) || (victim == LR_Player_Guard && attacker == LR_Player_Prisoner))
{
return Plugin_Continue;
}
else if (victim == LR_Player_Prisoner || victim == LR_Player_Guard || attacker == LR_Player_Prisoner || attacker == LR_Player_Guard)
{
damage = 0.0;
return Plugin_Changed;
}
else if (!gH_Cvar_LR_Damage.BoolValue)
if ((victim == LR_Player_Prisoner && attacker == LR_Player_Guard) || (victim == LR_Player_Guard && attacker == LR_Player_Prisoner))
{
return Plugin_Continue;
}
}
}

// Prevent players that are not in a LastRequest together from damaging each other
if (gH_Cvar_LR_Damage.BoolValue && type != LR_Rebel) // Ignore this check for the Rebel LastRequest
{
if ((attacker == LR_Player_Guard && victim != LR_Player_Prisoner) || (attacker == LR_Player_Prisoner && victim != LR_Player_Guard) && (GetClientTeam(attacker) != GetClientTeam(victim)))
{
return Plugin_Handled;
}
else if (((attacker != LR_Player_Guard && victim == LR_Player_Prisoner) || (attacker != LR_Player_Prisoner && victim == LR_Player_Guard)) && attacker != victim)
{
return Plugin_Handled;
}
}
}
}
}
Expand Down

0 comments on commit 087a979

Please sign in to comment.