Turn the player hooks into a tristate

This commit is contained in:
Ruby Rose 2017-07-11 10:37:17 +03:00
parent 1cdd33a78a
commit 79f66f554f
5 changed files with 85 additions and 25 deletions

View file

@ -1265,8 +1265,10 @@ namespace TShockAPI
/// <returns>True if the player has that permission.</returns>
public bool HasPermission(string permission)
{
if (PlayerHooks.OnPlayerPermission(this, permission))
return true;
PermissionResult hookResult = PlayerHooks.OnPlayerPermission(this, permission);
if (hookResult != PermissionResult.Inconclusive)
return hookResult == PermissionResult.Granted;
if (tempGroup != null)
return tempGroup.HasPermission(permission);