From 8d2d41d0c9e3ce2a1e1d492d19755e15cdacc393 Mon Sep 17 00:00:00 2001 From: darkunderdog Date: Fri, 12 Aug 2011 00:03:43 -0500 Subject: [PATCH] Adding getting region name for region messages --- TShockAPI/DB/RegionManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index 3e9ebf77..d45ed084 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -342,6 +342,20 @@ namespace TShockAPI.DB return false; } + public string InAreaRegionName(int x, int y) + { + foreach (Region region in Regions) + { + if (x >= region.Area.Left && x <= region.Area.Right && + y >= region.Area.Top && y <= region.Area.Bottom && + region.DisableBuild) + { + return region.Name; + } + } + return null; + } + public static List ListIDs(string MergedIDs) { return MergedIDs.Split(new []{','}, StringSplitOptions.RemoveEmptyEntries).ToList();