Fixes TSDEV-129

Explicitly check for projectile exploit to kick/ban while ignoring other packets that can potentially crash clients.
This commit is contained in:
Deathmax 2011-09-06 18:38:35 +08:00
parent a14299ee32
commit 612b629a9b

View file

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