diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index f05c8a8f..f8cc983b 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -195,7 +195,13 @@ 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; + [Description("The maximum damage a player/npc can inflict")] public int MaxDamage = 175; + + [Description("The maximum damage a projectile can inflict")] public int MaxProjDamage = 175; + + [Description("Ignores checking to see if player 'can' update a projectile")] public bool IgnoreProjUpdate = false; + + [Description("Ignores checking to see if player 'can' kill a projectile")] public bool IgnoreProjKill = false; public static ConfigFile Read(string path) { diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 7b272e5e..8ee3e152 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1538,7 +1538,7 @@ namespace TShockAPI if (dmg > TShock.Config.MaxProjDamage) { - args.Player.Disable("Projectile damage is higher than 175"); + args.Player.Disable(String.Format("Projectile damage is higher than {0}", TShock.Config.MaxProjDamage)); args.Player.RemoveProjectile(ident, owner); return true; } @@ -1549,9 +1549,9 @@ namespace TShockAPI return true; } - if (TShock.CheckProjectilePermission(args.Player, index, type)) + if (!TShock.Config.IgnoreProjUpdate && TShock.CheckProjectilePermission(args.Player, index, type)) { - args.Player.Disable("Does not have projectile permission to update projectile"); + args.Player.Disable("Does not have projectile permission to update projectile."); args.Player.RemoveProjectile(ident, owner); return true; } @@ -1591,7 +1591,7 @@ namespace TShockAPI var type = Main.projectile[index].type; - if (args.Player.Index != Main.projectile[index].owner && type != 102 && type != 100) // workaround for skeletron prime projectiles + if (args.Player.Index != Main.projectile[index].owner && type != 102 && type != 100 && !TShock.Config.IgnoreProjKill) // workaround for skeletron prime projectiles { args.Player.Disable("Owner and player ID does not match to kill projectile"); args.Player.RemoveProjectile(ident, owner); @@ -1604,7 +1604,7 @@ namespace TShockAPI return true; } - if (TShock.CheckProjectilePermission(args.Player, index, type) && type != 102 && type != 100) + if (TShock.CheckProjectilePermission(args.Player, index, type) && type != 102 && type != 100 && !TShock.Config.IgnoreProjKill) { args.Player.Disable("Does not have projectile permission to kill projectile"); args.Player.RemoveProjectile(ident, owner); @@ -2031,7 +2031,7 @@ namespace TShockAPI if (dmg > TShock.Config.MaxDamage) { - args.Player.Disable("Player damage exceeded 175"); + args.Player.Disable(String.Format("Player damage exceeded {0}", TShock.Config.MaxDamage ) ); args.Player.SendData(PacketTypes.PlayerHp, "", id); args.Player.SendData(PacketTypes.PlayerUpdate, "", id); return true; @@ -2084,7 +2084,7 @@ namespace TShockAPI if (dmg > TShock.Config.MaxDamage) { - args.Player.Disable("NPC damage exceeded 175"); + args.Player.Disable(String.Format("NPC damage exceeded {0}", TShock.Config.MaxDamage ) ); args.Player.SendData(PacketTypes.NpcUpdate, "", id); return true; } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index af6f26ba..5c2f32b4 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1067,6 +1067,7 @@ namespace TShockAPI if (proj.hostile) { + //player.SendMessage( proj.name, Color.Yellow); return true; }