Move TShock.CheckRangePermission to TSPlayer

TShock.CheckRangePermission is now TSPlayer.IsInRange, but the most
important thing is that this method returns the opposite of what the
original did, so all of the calls that would go to it are now inverted.
This commit is contained in:
Lucas Nicodemus 2017-12-21 20:32:07 -07:00
parent d4cb07379b
commit 09121368e4
5 changed files with 35 additions and 38 deletions

View file

@ -321,6 +321,20 @@ namespace TShockAPI
public bool SilentJoinInProgress;
/// <summary>Checks if a player has permission to modify a tile dependent on range checks.</summary>
/// <param name="x"> The x coordinate of the tile.</param>
/// <param name="y">The y coordinate of the tile.</param>
/// <param name="range">The range to check for.</param>
/// <returns>True if the player is in range of a tile or if range checks are off. False if not.</returns>
public bool IsInRange(int x, int y, int range = 32)
{
if (TShock.Config.RangeChecks && ((Math.Abs(TileX - x) > range) || (Math.Abs(TileY - y) > range)))
{
return false;
}
return true;
}
/// <summary>
/// A list of points where ice tiles have been placed.
/// </summary>