From 530bc951230544b7ff7ddd89602dab5c755a73e1 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Sat, 27 Jun 2020 10:22:03 +0200 Subject: [PATCH] RequestTileEntityInteractionHandler - Use object size for building perm check. This commit will modify the RequestTileEntityInteractionHandler to use HasBuildPermissionForTileObject when checking for building permissions for Hat Rack and Display Doll to give an accurate response wether or not any part of the object has an overlapping protected region. --- TShockAPI/Handlers/RequestTileEntityInteractionHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Handlers/RequestTileEntityInteractionHandler.cs b/TShockAPI/Handlers/RequestTileEntityInteractionHandler.cs index cb4e80ea..b2505307 100644 --- a/TShockAPI/Handlers/RequestTileEntityInteractionHandler.cs +++ b/TShockAPI/Handlers/RequestTileEntityInteractionHandler.cs @@ -17,13 +17,13 @@ namespace TShockAPI.Handlers { public void OnReceive(object sender, RequestTileEntityInteractionEventArgs args) { - if (args.TileEntity is TEHatRack && !args.Player.HasBuildPermission(args.TileEntity.Position.X, args.TileEntity.Position.Y, false)) + if (args.TileEntity is TEHatRack && !args.Player.HasBuildPermissionForTileObject(args.TileEntity.Position.X, args.TileEntity.Position.Y, TEHatRack.entityTileWidth, TEHatRack.entityTileHeight, false)) { args.Player.SendErrorMessage("You do not have permission to modify a Hat Rack in a protected area!"); args.Handled = true; return; } - else if (args.TileEntity is TEDisplayDoll && !args.Player.HasBuildPermission(args.TileEntity.Position.X, args.TileEntity.Position.Y, false)) + else if (args.TileEntity is TEDisplayDoll && !args.Player.HasBuildPermissionForTileObject(args.TileEntity.Position.X, args.TileEntity.Position.Y, TEDisplayDoll.entityTileWidth, TEDisplayDoll.entityTileHeight, false)) { args.Player.SendErrorMessage("You do not have permission to modify a Mannequin in a protected area!"); args.Handled = true;