From 612b629a9b24203d196ff3a0d94e49bc94974808 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Tue, 6 Sep 2011 18:38:35 +0800 Subject: [PATCH] Fixes TSDEV-129 Explicitly check for projectile exploit to kick/ban while ignoring other packets that can potentially crash clients. --- TShockAPI/GetDataHandlers.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index d6341b86..7a93f042 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -480,12 +480,18 @@ namespace TShockAPI return true; } - if (type == 23 && (vely == 0f || velx == 0f)) //float.IsNaN((float)Math.Sqrt((double)(velx * velx + vely * vely)))) + if (type == 23) { - Tools.HandleGriefer(args.Player, TShock.Config.ProjectileAbuseReason); - return true; + if (velx == 0f && vely == 0f && dmg == 99) + { + Tools.HandleGriefer(args.Player, TShock.Config.ProjectileAbuseReason); + return true; + } + else if (velx == 0f || vely == 0f) + 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));