Copied and pasted old region checking code.
This commit is contained in:
parent
b98c84fa5b
commit
0e9624ace3
1 changed files with 4 additions and 2 deletions
|
|
@ -219,9 +219,11 @@ namespace TShockAPI.DB
|
||||||
|
|
||||||
public bool InArea(int x, int y)
|
public bool InArea(int x, int y)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < Regions.Count; i++)
|
foreach(Region region in Regions)
|
||||||
{
|
{
|
||||||
if (Regions[i].InArea(new Rectangle(x, y, 0, 0)) && Regions[i].DisableBuild == 0)
|
if (x >= region.RegionArea.Left && x <= region.RegionArea.Right &&
|
||||||
|
y >= region.RegionArea.Top && y <= region.RegionArea.Bottom &&
|
||||||
|
region.DisableBuild == 1)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue