From 5e9cfb27918af6dc81ce33c548a42319bff7a6bb Mon Sep 17 00:00:00 2001 From: Deathmax Date: Fri, 16 Sep 2011 19:58:59 +0800 Subject: [PATCH] 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. --- TShockAPI/GetDataHandlers.cs | 7 +++++++ TShockAPI/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index b426264c..573f5e18 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -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)) { diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index 480d2285..e57ee783 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -36,5 +36,5 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.3.3.0906")] -[assembly: AssemblyFileVersion("3.3.3.0906")] +[assembly: AssemblyVersion("3.3.3.0916")] +[assembly: AssemblyFileVersion("3.3.3.0916")]