summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-05-26 02:15:48 -0400
committerAdam <Adam@anope.org>2012-05-26 02:15:48 -0400
commit2cbfbc98e9bab3b63adf307bb9066203600ef16e (patch)
treebd5130a6a83af8f671f9e3817ff31caec070603c /src/config.cpp
parent38d5f20deba313355943883b7b539a82f7a701ee (diff)
Some access level fixes from Robby to more closely match the historic levels, and some code cleanup
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp13
1 files changed, 3 insertions, 10 deletions
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<int>(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},
{"",
{""},