From 2185b187050b6385fa40cf05814e8c5dd03b2831 Mon Sep 17 00:00:00 2001 From: k0rd Date: Mon, 30 Sep 2013 04:46:32 -0400 Subject: [PATCH] allow explosives to break tiles --- TShockAPI/GetDataHandlers.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index c3b3bff9..6e088865 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1796,32 +1796,34 @@ namespace TShockAPI if (type == 0 && Main.tile[tileX, tileY].type != 127 && !Main.tileCut[Main.tile[tileX, tileY].type] && !rightClickKill.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) + if (Main.tileAxe[Main.tile[tileX, tileY].type] && (selectedItem.axe == 0 && selectedItem.explosive == 0)) { args.Player.SendTileSquare(tileX, tileY); return true; } // If the tile is a hammer tile and they aren't selecting an hammer, they're hacking. - else if (Main.tileHammer[Main.tile[tileX, tileY].type] && selectedItem.hammer == 0) + else if (Main.tileHammer[Main.tile[tileX, tileY].type] && (selectedItem.hammer == 0 && selectedItem.explosive == 0)) { args.Player.SendTileSquare(tileX, tileY); return true; } // If the tile is a pickaxe tile and they aren't selecting an pickaxe, they're hacking. - else if ((!Main.tileAxe[Main.tile[tileX, tileY].type] && !Main.tileHammer[Main.tile[tileX, tileY].type]) && selectedItem.pick == 0) + else if ((!Main.tileAxe[Main.tile[tileX, tileY].type] && !Main.tileHammer[Main.tile[tileX, tileY].type]) && (selectedItem.pick == 0 && selectedItem.explosive == 0)) { args.Player.SendTileSquare(tileX, tileY); + return true; } } else if (action == EditAction.KillWall) { // If they aren't selecting an hammer, they're hacking. - if (selectedItem.hammer == 0) + if (selectedItem.hammer == 0 && selectedItem.explosive == 0) { args.Player.SendTileSquare(tileX, tileY); return true; } + } else if (action == EditAction.PlaceTile || action == EditAction.PlaceWall) {