From ffa64e4474e5dbd8c2c358bf7b018afbfd759c4b Mon Sep 17 00:00:00 2001 From: ProfessorXZ Date: Tue, 19 Jul 2016 00:02:52 +0200 Subject: [PATCH] Fixes #1241 --- TShockAPI/GetDataHandlers.cs | 12 ++++++++++-- TShockAPI/TShock.cs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 23051601..6d64915b 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2045,6 +2045,14 @@ namespace TShockAPI args.Player.SendTileSquare(tileX, tileY, 4); return true; } + + // Using the actuation accessory can lead to actuator hacking + if (TShock.Itembans.ItemIsBanned("Actuator", args.Player) && args.Player.Accessories.Any(accessory => accessory != null && accessory.stack > 0 && accessory.type == ItemID.ActuationAccessory)) + { + args.Player.SendTileSquare(tileX, tileY, 1); + args.Player.SendErrorMessage("You do not have permission to place actuators."); + return true; + } if (TShock.Itembans.ItemIsBanned(selectedItem.name, args.Player) || editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes)) { args.Player.SendTileSquare(tileX, tileY, 4); @@ -2102,8 +2110,8 @@ namespace TShockAPI else if (action == EditAction.PlaceActuator) { // If they aren't selecting the actuator and don't have the Presserator equipped, they're hacking. - // ActuationAccessorry = The Presserator - if (selectedItem.type != ItemID.Actuator && !args.Player.Accessories.Any(accessory => accessory.type == ItemID.ActuationAccessory)) + // ActuationAccessory = The Presserator + if (selectedItem.type != ItemID.Actuator && !args.Player.Accessories.Any(accessory => accessory != null && accessory.stack > 0 && accessory.type == ItemID.ActuationAccessory)) { args.Player.SendTileSquare(tileX, tileY, 1); return true; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 88e236d5..0b49203a 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1341,7 +1341,7 @@ namespace TShockAPI } catch (Exception ex) { - Log.ConsoleError("An exeption occurred executing a command."); + Log.ConsoleError("An exception occurred executing a command."); Log.Error(ex.ToString()); } }