summaryrefslogtreecommitdiff
path: root/modules/core/os_modload.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-28 22:44:34 -0400
committerAdam <Adam@anope.org>2011-05-16 04:09:32 -0400
commit583954d3a1db658281a9afb7b7dd6773726c8c11 (patch)
tree6a00865d5738c6d0bc42efb35f3f468c5876eb3e /modules/core/os_modload.cpp
parent8fb1604f649bec6f356770daf5df6bb8ab811bbf (diff)
Use module type to determine what type each module is instead of its location in the configuration file.
Diffstat (limited to 'modules/core/os_modload.cpp')
-rw-r--r--modules/core/os_modload.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/core/os_modload.cpp b/modules/core/os_modload.cpp
index ff41b5235..39687eeec 100644
--- a/modules/core/os_modload.cpp
+++ b/modules/core/os_modload.cpp
@@ -27,13 +27,6 @@ class CommandOSModLoad : public Command
User *u = source.u;
const Anope::string &mname = params[0];
- Module *m = FindModule(mname);
- if (m)
- {
- source.Reply(_("Module \002%s\002 is already loaded."), mname.c_str());
- return MOD_CONT;
- }
-
ModuleReturn status = ModuleManager::LoadModule(mname, u);
if (status == MOD_ERR_OK)
{
@@ -43,10 +36,12 @@ class CommandOSModLoad : public Command
/* If a user is loading this module, then the core databases have already been loaded
* so trigger the event manually
*/
- m = FindModule(mname);
+ Module *m = ModuleManager::FindModule(mname);
if (m)
m->OnPostLoadDatabases();
}
+ else if (status == MOD_ERR_EXISTS)
+ source.Reply(_("Module \002%s\002 is already loaded."), mname.c_str());
else
source.Reply(_("Unable to load module \002%s\002"), mname.c_str());
@@ -73,10 +68,9 @@ class OSModLoad : public Module
CommandOSModLoad commandosmodload;
public:
- OSModLoad(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
+ OSModLoad(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE)
{
this->SetAuthor("Anope");
- this->SetType(CORE);
this->SetPermanent(true);
if (!operserv)