From 564d5f0cb1fb1ea45cb7b8c2e0fbda5a4ca2ac54 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Thu, 19 Jan 2012 22:10:34 +0800 Subject: [PATCH] Allow players to ignore the damage caps. --- TShockAPI/GetDataHandlers.cs | 4 ++-- TShockAPI/Permissions.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 807a1b75..a9ba102b 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2026,7 +2026,7 @@ namespace TShockAPI if (TShock.Players[id] == null) return true; - if (dmg > TShock.Config.MaxDamage) + if (dmg > TShock.Config.MaxDamage && !args.Player.Group.HasPermission(Permissions.ignoredamagecap)) { args.Player.Disable(String.Format("Player damage exceeded {0}", TShock.Config.MaxDamage ) ); args.Player.SendData(PacketTypes.PlayerHp, "", id); @@ -2079,7 +2079,7 @@ namespace TShockAPI if (Main.npc[id] == null) return true; - if (dmg > TShock.Config.MaxDamage) + if (dmg > TShock.Config.MaxDamage && !args.Player.Group.HasPermission(Permissions.ignoredamagecap)) { args.Player.Disable(String.Format("NPC damage exceeded {0}", TShock.Config.MaxDamage ) ); args.Player.SendData(PacketTypes.NpcUpdate, "", id); diff --git a/TShockAPI/Permissions.cs b/TShockAPI/Permissions.cs index 93df1ca0..06421b93 100644 --- a/TShockAPI/Permissions.cs +++ b/TShockAPI/Permissions.cs @@ -63,6 +63,9 @@ namespace TShockAPI [Description("Prevents you from being kicked by hacked health detection")] public static readonly string ignorestathackdetection; + [Description("Prevents your attacks from being ignored if your damage is too high")] public static readonly string + ignoredamagecap; + [Description("Specific log messages are sent to users with this permission")] public static readonly string logs; [Description("Allows you to bypass the max slots for up to 5 slots above your max")] public static readonly string