summaryrefslogtreecommitdiff
path: root/src/modules/m_customprefix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_customprefix.cpp')
-rw-r--r--src/modules/m_customprefix.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp
index 67d1d2fe9..d627bbb96 100644
--- a/src/modules/m_customprefix.cpp
+++ b/src/modules/m_customprefix.cpp
@@ -25,8 +25,8 @@ class CustomPrefixMode : public ModeHandler
{
public:
reference<ConfigTag> tag;
- int rank;
bool depriv;
+
CustomPrefixMode(Module* parent, ConfigTag* Tag)
: ModeHandler(parent, Tag->getString("name"), 0, PARAM_ALWAYS, MODETYPE_CHANNEL), tag(Tag)
{
@@ -36,16 +36,11 @@ class CustomPrefixMode : public ModeHandler
prefix = v.c_str()[0];
v = tag->getString("letter");
mode = v.c_str()[0];
- rank = tag->getInt("rank");
- levelrequired = tag->getInt("ranktoset", rank);
+ prefixrank = tag->getInt("rank");
+ levelrequired = tag->getInt("ranktoset", prefixrank);
depriv = tag->getBool("depriv", true);
}
- unsigned int GetPrefixRank()
- {
- return rank;
- }
-
ModResult AccessCheck(User* src, Channel*, std::string& value, bool adding)
{
if (!adding && src->nick == value && depriv)
@@ -72,7 +67,7 @@ class ModuleCustomPrefix : public Module
tags.first++;
CustomPrefixMode* mh = new CustomPrefixMode(this, tag);
modes.push_back(mh);
- if (mh->rank <= 0)
+ if (mh->GetPrefixRank() == 0)
throw ModuleException("Rank must be specified for prefix at " + tag->getTagLocation());
if (!isalpha(mh->GetModeChar()))
throw ModuleException("Mode must be a letter for prefix at " + tag->getTagLocation());