diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 5737024e..64db25f4 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -93,6 +93,7 @@ namespace TShockAPI public string TileKillAbuseReason = "Tile Kill abuse ({0})"; public string HardcoreBanReason = "Death results in a ban"; public string HardcoreKickReason = "Death results in a kick"; + public string ProjectileAbuseReason = "Projectile abuse"; public bool EnableDNSHostResolution; diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 59cd78b1..2b829071 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -414,6 +414,18 @@ namespace TShockAPI byte owner = args.Data.ReadInt8(); byte type = args.Data.ReadInt8(); + if (ident > Main.maxProjectiles || ident < 0) + { + Tools.HandleGriefer(args.Player, TShock.Config.ExplosiveAbuseReason); + return true; + } + + if ((vely == 0f || velx == 0f) && type == 23) + { + Tools.HandleGriefer(args.Player, TShock.Config.ProjectileAbuseReason); + return true; + } + if (type == 29 || type == 28 || type == 37) { Log.Debug(string.Format("Explosive(PlyXY:{0}_{1}, Type:{2})", args.Player.TileX, args.Player.TileY, type));