Improve HealOtherPlayer 0.2 check

Since this check is based on damage and healing amount is based on 20% of the damage, it makes more sense to skip the check if the player has ignoredamagecap (trustedadmin and higher).
This commit is contained in:
stacey 2021-05-12 12:09:11 -04:00 committed by GitHub
parent 563c439aee
commit 10318f032a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1605,10 +1605,13 @@ namespace TShockAPI
// and the healing you can do with that is 20% of your damage.
if (amount >= TShock.Config.Settings.MaxDamage * 0.2)
{
if (!args.Player.HasPermission(Permissions.ignoredamagecap)
{
TShock.Log.ConsoleDebug("Bouncer / OnHealOtherPlayer 0.2 check from {0}", args.Player.Name);
args.Player.Disable("HealOtherPlayer cheat attempt!", DisableFlags.WriteToLogAndConsole);
args.Handled = true;
return;
}
}
if (args.Player.HealOtherThreshold >= TShock.Config.Settings.HealOtherThreshold)