From 16093fd9ca4c1cae2ef8736535ddc06105435fc8 Mon Sep 17 00:00:00 2001 From: MarioE Date: Mon, 21 Oct 2013 17:22:59 -0400 Subject: [PATCH] Fix another sendtilesquare exploit ... removing EnableInsecureTileFixes in the process. --- TShockAPI/ConfigFile.cs | 4 ---- TShockAPI/GetDataHandlers.cs | 13 +++---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 152a8ab8..5d0ae8ff 100755 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -146,10 +146,6 @@ namespace TShockAPI [Description("Displays a player's IP on join to everyone who has the log permission.")] public bool DisplayIPToAdmins; - [Description( - "Some tiles are 'fixed' by not letting TShock handle them. Disabling this may break certain aesthetic tiles.")] public - bool EnableInsecureTileFixes = true; - [Description("Kicks users using a proxy as identified with the GeoIP database.")] public bool KickProxyUsers = true; [Description("Disables hardmode, can't never be activated. Overrides /starthardmode.")] public bool DisableHardmode; diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index b987d4e4..a05a30ac 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1604,7 +1604,7 @@ namespace TShockAPI /// /// Tiles that can be oriented (e.g., beds, chairs, bathtubs, etc). /// - private static byte[] orientableTiles = new byte[] { 15, 79, 90, 128, 137, 209 }; + private static byte[] orientableTiles = new byte[] { 15, 79, 90, 105, 128, 137, 139, 209 }; private static bool HandleSendTileSquare(GetDataHandlerArgs args) { @@ -1667,14 +1667,7 @@ namespace TShockAPI { continue; } - if ((tile.type == 128 && newtile.Type == 128) || (tile.type == 105 && newtile.Type == 105) || (tile.type == 139 && newtile.Type == 139)) - { - if (TShock.Config.EnableInsecureTileFixes) - { - return false; - } - } - + // Orientable tiles if (tile.type == newtile.Type && orientableTiles.Contains(tile.type)) { @@ -1846,7 +1839,7 @@ namespace TShockAPI } Item selectedItem = args.Player.SelectedItem; - if (type == 0 && !Main.tileCut[Main.tile[tileX, tileY].type] && !breakableTiles.Contains(Main.tile[tileX, tileY].type)) + if (action == EditAction.KillTile && !Main.tileCut[Main.tile[tileX, tileY].type] && !breakableTiles.Contains(Main.tile[tileX, tileY].type)) { // If the tile is an axe tile and they aren't selecting an axe, they're hacking. if (Main.tileAxe[Main.tile[tileX, tileY].type] && (selectedItem.axe == 0 && selectedItem.explosive == 0 && args.Player.RecentFuse == 0))