Updated Regions.InAreaRegion.Name to allow overlapping regions - For plugins that use this it will require updating the code
This commit is contained in:
parent
62bc28332a
commit
6079d84c9e
2 changed files with 19 additions and 16 deletions
|
|
@ -258,19 +258,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 List<string> InAreaRegionName(int x, int y)
|
||||
{
|
||||
List<string> regions = new List<string>() { };
|
||||
foreach (Region region in Regions)
|
||||
{
|
||||
if (x >= region.Area.Left && x <= region.Area.Right &&
|
||||
y >= region.Area.Top && y <= region.Area.Bottom &&
|
||||
region.DisableBuild)
|
||||
{
|
||||
regions.Add(region.Name);
|
||||
}
|
||||
}
|
||||
return regions;
|
||||
}
|
||||
|
||||
public static List<string> ListIDs(string MergedIDs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue