diff options
-rw-r--r-- | src/opertype.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/opertype.cpp b/src/opertype.cpp index 38a1f2f50..c6e016043 100644 --- a/src/opertype.cpp +++ b/src/opertype.cpp @@ -60,7 +60,11 @@ bool OperType::HasCommand(const Anope::string &cmdstr) const { for (std::list<Anope::string>::const_iterator it = this->commands.begin(), it_end = this->commands.end(); it != it_end; ++it) { - if (Anope::Match(cmdstr, *it)) + const Anope::string &s = *it; + + if (!s.find('~') && Anope::Match(cmdstr, s.substr(1))) + return false; + else if (Anope::Match(cmdstr, s)) return true; } for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit) @@ -78,7 +82,11 @@ bool OperType::HasPriv(const Anope::string &privstr) const { for (std::list<Anope::string>::const_iterator it = this->privs.begin(), it_end = this->privs.end(); it != it_end; ++it) { - if (Anope::Match(privstr, *it)) + const Anope::string &s = *it; + + if (!s.find('~') && Anope::Match(privstr, s.substr(1))) + return false; + else if (Anope::Match(privstr, s)) return true; } for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit) |