This commit is contained in:
ProfessorXZ 2016-07-19 00:02:52 +02:00
parent 23991600b6
commit ffa64e4474
2 changed files with 11 additions and 3 deletions

View file

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

View file

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