From 2cbfbc98e9bab3b63adf307bb9066203600ef16e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 26 May 2012 02:15:48 -0400 Subject: Some access level fixes from Robby to more closely match the historic levels, and some code cleanup --- src/config.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/config.cpp b/src/config.cpp index 8e45097a7..0c5d1c2af 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -895,7 +895,7 @@ static bool DoPrivileges(ServerConfig *config, const Anope::string &, const Anop { Anope::string name = values[0].GetValue(); Anope::string desc = values[1].GetValue(); - Anope::string rank = values[2].GetValue(); + int rank = values[2].GetInteger(); ValueItem vi(name); if (!ValidateNotEmpty(config, "privilege", "name", vi)) @@ -905,14 +905,7 @@ static bool DoPrivileges(ServerConfig *config, const Anope::string &, const Anop if (!ValidateNotEmpty(config, "privilege", "desc", vi)) throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information."); - int irank = 0; - try - { - irank = convertTo(rank); - } - catch (const ConvertException &) { } - - PrivilegeManager::AddPrivilege(Privilege(name, desc, irank)); + PrivilegeManager::AddPrivilege(Privilege(name, desc, rank)); return true; } @@ -1353,7 +1346,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"privilege", {"name", "desc", "rank", ""}, {"", "", "", ""}, - {DT_STRING, DT_STRING, DT_STRING, DT_STRING}, + {DT_STRING, DT_STRING, DT_INTEGER, DT_STRING}, InitPrivileges, DoPrivileges, DonePrivileges}, {"", {""}, -- cgit