From 66619d91489a3d29e9da779f4900be7668c8b209 Mon Sep 17 00:00:00 2001 From: high Date: Wed, 8 Jun 2011 06:16:42 -0400 Subject: [PATCH] Fixed chests not being breakable --- TShockAPI/TShock.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index ce7ee2b5..2676020f 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -466,7 +466,17 @@ namespace TShockAPI bool HandleTileKill(MemoryStream data, GetDataEventArgs e) { - return true; + int tilex = data.ReadInt32(); + int tiley = data.ReadInt32(); + if (tilex < 0 || tilex >= Main.maxTilesX || tiley < 0 || tiley >= Main.maxTilesY) + return false; + + if (Main.tile[tilex, tiley].type != 0x15) //Chest + { + Tools.Kick(e.Msg.whoAmI, "Tile Kill abuse (" + Main.tile[tilex, tiley].type + ")"); + return true; + } + return false; } private void OnGreetPlayer(int who, HandledEventArgs e)