Fix loops.

This commit is contained in:
ElgarL 2013-03-28 13:10:17 +00:00
parent e15a8c50d6
commit 231f9d49c1

View File

@ -875,14 +875,14 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "You can't modify a player with same group as you, or higher.");
return true;
}
for (auxString : auxUser.getPermissionList()) {
permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString);
for (String perm : auxUser.getPermissionList()) {
permissionResult = permissionHandler.checkFullUserPermission(senderUser, perm);
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
sender.sendMessage(ChatColor.RED + "You can't remove a permission you don't have: '" + auxString + "'.");
sender.sendMessage(ChatColor.RED + "You can't remove a permission you don't have: '" + perm + "'.");
}
else
{
auxUser.removePermission(auxString);
auxUser.removePermission(perm);
}
}
sender.sendMessage(ChatColor.YELLOW + "You removed all permissions from player '" + auxUser.getName() + "'.");
@ -1159,14 +1159,14 @@ public class GroupManager extends JavaPlugin {
return true;
}
for (auxString : auxGroup.getPermissionList()) {
permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString);
for (String perm : auxGroup.getPermissionList()) {
permissionResult = permissionHandler.checkFullUserPermission(senderUser, perm);
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have: '" + auxString + "'.");
sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have: '" + perm + "'.");
}
else
{
auxGroup.removePermission(auxString);
auxGroup.removePermission(perm);
}
}
sender.sendMessage(ChatColor.YELLOW + "You removed all permissions from group '" + auxGroup.getName() + "'.");