From 00b2d768d706927252c12a2aed0fa97e027a0677 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Sat, 14 Jan 2012 23:03:28 -0500 Subject: [PATCH] Added config options for max damage and projectile max damage --- TShockAPI/ConfigFile.cs | 2 ++ TShockAPI/GetDataHandlers.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index c708f7b3..f05c8a8f 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -195,6 +195,8 @@ namespace TShockAPI [Description("Allows users to login with any username with /login")] public bool AllowLoginAnyUsername = true; + [Description("Allows users to login with any username with /login")] public int MaxDamage = 175; + public static ConfigFile Read(string path) { if (!File.Exists(path)) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 05d6d4a6..7b272e5e 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1536,7 +1536,7 @@ namespace TShockAPI return true; } - if (dmg > 175) + if (dmg > TShock.Config.MaxProjDamage) { args.Player.Disable("Projectile damage is higher than 175"); args.Player.RemoveProjectile(ident, owner); @@ -2029,7 +2029,7 @@ namespace TShockAPI if (TShock.Players[id] == null) return true; - if (dmg > 175) + if (dmg > TShock.Config.MaxDamage) { args.Player.Disable("Player damage exceeded 175"); args.Player.SendData(PacketTypes.PlayerHp, "", id); @@ -2082,7 +2082,7 @@ namespace TShockAPI if (Main.npc[id] == null) return true; - if (dmg > 175) + if (dmg > TShock.Config.MaxDamage) { args.Player.Disable("NPC damage exceeded 175"); args.Player.SendData(PacketTypes.NpcUpdate, "", id);