diff options
Diffstat (limited to 'modules/core')
| -rw-r--r-- | modules/core/cs_access.cpp | 8 | ||||
| -rw-r--r-- | modules/core/cs_info.cpp | 2 | ||||
| -rw-r--r-- | modules/core/cs_set_mlock.cpp | 2 | ||||
| -rw-r--r-- | modules/core/db_plain.cpp | 6 |
4 files changed, 11 insertions, 7 deletions
diff --git a/modules/core/cs_access.cpp b/modules/core/cs_access.cpp index c6714cf05..a2db35046 100644 --- a/modules/core/cs_access.cpp +++ b/modules/core/cs_access.cpp @@ -462,7 +462,9 @@ class CommandCSLevels : public Command Anope::string lev = params[3]; Anope::string error; - int level = convertTo<int>(lev, error, false); + int level = (lev.is_number_only() ? convertTo<int>(lev, error, false) : 0); + if (!lev.is_number_only()) + error = "1"; if (lev.equals_ci("FOUNDER")) { @@ -475,6 +477,7 @@ class CommandCSLevels : public Command else if (level <= ACCESS_INVALID || level > ACCESS_FOUNDER) notice_lang(Config->s_ChanServ, u, CHAN_LEVELS_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1); else + { for (int i = 0; levelinfo[i].what >= 0; ++i) { if (what.equals_ci(levelinfo[i].name)) @@ -493,7 +496,8 @@ class CommandCSLevels : public Command } } - notice_lang(Config->s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what.c_str(), Config->s_ChanServ.c_str()); + notice_lang(Config->s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what.c_str(), Config->s_ChanServ.c_str()); + } return MOD_CONT; } diff --git a/modules/core/cs_info.cpp b/modules/core/cs_info.cpp index add7f39ff..b25eeb0ea 100644 --- a/modules/core/cs_info.cpp +++ b/modules/core/cs_info.cpp @@ -57,7 +57,7 @@ class CommandCSInfo : public Command } /* Should we show all fields? Only for sadmins and identified users */ - if (has_auspex && check_access(u, ci, CA_INFO)) + if (has_auspex || check_access(u, ci, CA_INFO)) show_all = true; notice_lang(Config->s_ChanServ, u, CHAN_INFO_HEADER, chan.c_str()); diff --git a/modules/core/cs_set_mlock.cpp b/modules/core/cs_set_mlock.cpp index cfae860a7..b4c117d05 100644 --- a/modules/core/cs_set_mlock.cpp +++ b/modules/core/cs_set_mlock.cpp @@ -65,7 +65,7 @@ class CommandCSSetMLock : public Command if (paramcount >= params.size()) continue; - Anope::string param = params[paramcount]; + Anope::string param = params[paramcount++]; ChannelModeParam *cmp = debug_cast<ChannelModeParam *>(cm); diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp index 643146f5d..ea366d299 100644 --- a/modules/core/db_plain.cpp +++ b/modules/core/db_plain.cpp @@ -770,9 +770,9 @@ class DBPlain : public Module else if (key.equals_ci("MLP")) { std::vector<std::pair<Anope::string, Anope::string> > mlp; - - for (unsigned j = 0, end = params.size(); j < end; j += 2) - mlp.push_back(std::make_pair(params[j], params[j + 1])); + ci->GetExtRegular("db_mlp", mlp); + + mlp.push_back(std::make_pair(params[0], params[1])); /* For now store mlocked modes in extensible, Anope hasn't yet connected to the IRCd and doesn't know what modes exist */ ci->Extend("db_mlp", new ExtensibleItemRegular<std::vector<std::pair<Anope::string, Anope::string> > >(mlp)); |
