Fixes #1161
This commit is contained in:
parent
0c9489c2f1
commit
409327b54e
1 changed files with 7 additions and 2 deletions
|
|
@ -709,7 +709,7 @@ namespace TShockAPI.DB
|
||||||
/// <returns>Whether the point exists in the region's area</returns>
|
/// <returns>Whether the point exists in the region's area</returns>
|
||||||
public bool InArea(Rectangle point)
|
public bool InArea(Rectangle point)
|
||||||
{
|
{
|
||||||
return Area.Contains(point.X, point.Y);
|
return InArea(point.X, point.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -720,7 +720,12 @@ namespace TShockAPI.DB
|
||||||
/// <returns>Whether the coordinate exists in the region's area</returns>
|
/// <returns>Whether the coordinate exists in the region's area</returns>
|
||||||
public bool InArea(int x, int y) //overloaded with x,y
|
public bool InArea(int x, int y) //overloaded with x,y
|
||||||
{
|
{
|
||||||
return Area.Contains(x, y);
|
/*
|
||||||
|
DO NOT CHANGE TO Area.Contains(x, y)!
|
||||||
|
Area.Contains does not account for the right and bottom 'border' of the rectangle,
|
||||||
|
which results in regions being trimmed.
|
||||||
|
*/
|
||||||
|
return Area.X <= x && x <= Area.X + Area.Width && Area.Y <= y && y <= Area.Y + Area.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue