Added config options for max damage and projectile max damage

This commit is contained in:
Zack Piispanen 2012-01-14 23:03:28 -05:00
parent aa99c1d0b2
commit 00b2d768d7
2 changed files with 5 additions and 3 deletions

View file

@ -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))

View file

@ -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);