From 3b927b48ccb30619d9ace318b5a7d21f2279abbf Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 18 Oct 2017 04:00:04 +0100 Subject: Ignore tags for modules that are already loaded. This allows us to do user friendly things like loading the alias module in the example alias files. --- src/modules.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 5c5e5c5c0..6d0d3bf94 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -468,10 +468,14 @@ void ModuleManager::LoadAll() for (ConfigIter i = tags.first; i != tags.second; ++i) { ConfigTag* tag = i->second; - std::string name = tag->getString("name"); - this->NewServices = &servicemap[ExpandModName(name)]; - std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl; + std::string name = ExpandModName(tag->getString("name")); + this->NewServices = &servicemap[name]; + + // Skip modules which are already loaded. + if (Modules.find(name) != Modules.end()) + continue; + std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl; if (!this->Load(name, true)) { ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, this->LastError()); -- cgit v1.3.1-10-gc9f91