Prevent people from placing chests when the world's chest array is already full.

Prevents bugs with chests not properly working if placed after the array is full.
This commit is contained in:
Deathmax 2011-09-16 19:58:59 +08:00
parent a4176947ae
commit 5e9cfb2791
2 changed files with 9 additions and 2 deletions

View file

@ -349,6 +349,13 @@ namespace TShockAPI
args.Player.SendTileSquare(x, y);
return true;
}
if (type == 1 && tiletype == 21 && Tools.MaxChests())
{
args.Player.SendMessage("Reached world's max chest limit, unable to place more!", Color.Red);
Log.Info("Reached world's chest limit, unable to place more.");
args.Player.SendTileSquare(x, y);
return true;
}
}
if (!args.Player.Group.HasPermission(Permissions.editspawn) && !TShock.Regions.CanBuild(x, y, args.Player) && TShock.Regions.InArea(x, y))
{