Warn players if they can't modify the world

This reimplements warnings that CheckTilePermissions previously had. It
defaults to on because every single call currently in TShock expects it
to be on.
This commit is contained in:
Lucas Nicodemus 2017-12-22 01:27:14 -07:00
parent 7b2a4494b5
commit e370873fff
3 changed files with 23 additions and 7 deletions

View file

@ -533,11 +533,8 @@ namespace TShockAPI
short y = args.Y;
byte homeless = args.Homeless;
// Calls to TShock.CheckTilePermission need to be broken up into different subsystems
// In particular, this handles both regions and other things. Ouch.
if (!args.Player.HasBuildPermission(x, y))
{
args.Player.SendErrorMessage("You do not have access to modify this area.");
args.Player.SendData(PacketTypes.UpdateNPCHome, "", id, Main.npc[id].homeTileX, Main.npc[id].homeTileY,
Convert.ToByte(Main.npc[id].homeless));
args.Handled = true;