diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 1833f5c0..4055a65c 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4335,7 +4335,7 @@ namespace TShockAPI } int addAmount; int.TryParse(args.Parameters[3], out addAmount); - if (TShock.Regions.resizeRegion(args.Parameters[1], addAmount, direction)) + if (TShock.Regions.ResizeRegion(args.Parameters[1], addAmount, direction)) { args.Player.SendInfoMessage("Region Resized Successfully!"); TShock.Regions.Reload(); diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index 9b444c3c..5bd58d5f 100755 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -232,8 +232,7 @@ namespace TShockAPI.DB foreach (Region region in Regions.ToList()) { if (x >= region.Area.Left && x <= region.Area.Right && - y >= region.Area.Top && y <= region.Area.Bottom && - region.DisableBuild) + y >= region.Area.Top && y <= region.Area.Bottom) { return true; } @@ -247,8 +246,7 @@ namespace TShockAPI.DB foreach (Region region in Regions.ToList()) { if (x >= region.Area.Left && x <= region.Area.Right && - y >= region.Area.Top && y <= region.Area.Bottom && - region.DisableBuild) + y >= region.Area.Top && y <= region.Area.Bottom) { regions.Add(region.Name); } @@ -262,8 +260,7 @@ namespace TShockAPI.DB foreach (Region region in Regions.ToList()) { if (x >= region.Area.Left && x <= region.Area.Right && - y >= region.Area.Top && y <= region.Area.Bottom && - region.DisableBuild) + y >= region.Area.Top && y <= region.Area.Bottom) { regions.Add(region); } @@ -276,7 +273,7 @@ namespace TShockAPI.DB return MergedIDs.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList(); } - public bool resizeRegion(string regionName, int addAmount, int direction) + public bool ResizeRegion(string regionName, int addAmount, int direction) { //0 = up //1 = right @@ -390,7 +387,7 @@ namespace TShockAPI.DB foreach (var r in Regions) { if (r.Name == regionName && r.WorldID == Main.worldID.ToString()) - r.setAllowedIDs(mergedIDs); + r.SetAllowedIDs(mergedIDs); } return q != 0; } @@ -613,6 +610,10 @@ namespace TShockAPI.DB public bool HasPermissionToBuildInRegion(TSPlayer ply) { + if (!DisableBuild) + { + return true; + } if (!ply.IsLoggedIn) { if (!ply.HasBeenNaggedAboutLoggingIn) @@ -622,15 +623,11 @@ namespace TShockAPI.DB } return false; } - if (!DisableBuild) - { - return true; - } return AllowedIDs.Contains(ply.User.ID) || AllowedGroups.Contains(ply.Group.Name) || Owner == ply.User.Name; } - public void setAllowedIDs(String ids) + public void SetAllowedIDs(String ids) { String[] id_arr = ids.Split(','); List id_list = new List(); diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 87be39fb..5bdce6ae 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1967,6 +1967,8 @@ namespace TShockAPI if (action == EditAction.KillTile && !Main.tileCut[tile.type] && !breakableTiles.Contains(tile.type)) { + //TPlayer.mount.Type 8 => Drill Containment Unit. + // If the tile is an axe tile and they aren't selecting an axe, they're hacking. if (Main.tileAxe[tile.type] && ((args.Player.TPlayer.mount.Type != 8 && selectedItem.axe == 0) && !ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0)) {