diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index b7a7b7d41..d58944f1f 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -246,11 +246,12 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode unsigned int ourrank = chan->GetPrefixValue(user); if (ourrank < neededrank) { - PrefixMode* neededmh = NULL; - for(char c='A'; c <= 'z'; c++) + const PrefixMode* neededmh = NULL; + const PrefixModeList& prefixmodes = GetPrefixModes(); + for (PrefixModeList::const_iterator i = prefixmodes.begin(); i != prefixmodes.end(); ++i) { - PrefixMode* privmh = FindPrefixMode(c); - if (privmh && privmh->GetPrefixRank() >= neededrank) + const PrefixMode* const privmh = *i; + if (privmh->GetPrefixRank() >= neededrank) { // this mode is sufficient to allow this action if (!neededmh || privmh->GetPrefixRank() < neededmh->GetPrefixRank()) |