diff options
Diffstat (limited to 'src/modmanager_static.cpp')
| -rw-r--r-- | src/modmanager_static.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/modmanager_static.cpp b/src/modmanager_static.cpp index aa48b2d0a..9c5457cd9 100644 --- a/src/modmanager_static.cpp +++ b/src/modmanager_static.cpp @@ -184,22 +184,6 @@ void ModuleManager::LoadAll() } } - for(std::map<std::string, Module*>::iterator i = Modules.begin(); i != Modules.end(); i++) - { - Module* mod = i->second; - try - { - mod->init(); - } - catch (CoreException& modexcept) - { - LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason(); - ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); - printf_c("\n[\033[1;31m*\033[0m] %s\n\n", LastModuleError.c_str()); - ServerInstance->Exit(EXIT_STATUS_MODULE); - } - } - /* We give every module a chance to re-prioritize when we introduce a new one, * not just the one thats loading, as the new module could affect the preference * of others @@ -218,6 +202,25 @@ void ModuleManager::LoadAll() ServerInstance->Exit(EXIT_STATUS_MODULE); } } + + IntModuleList& initlist = EventHandlers[I_ModuleInit]; + for(size_t i=0; i < initlist.size(); i++) + { + Module* mod = initlist[i]; + try + { + ServerInstance->Logs->Log("MODULE", DEBUG, "Initializing %s", mod->ModuleSourceFile.c_str()); + mod->init(); + } + catch (CoreException& modexcept) + { + LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason(); + ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); + printf_c("\n[\033[1;31m*\033[0m] %s\n\n", LastModuleError.c_str()); + ServerInstance->Exit(EXIT_STATUS_MODULE); + } + } + initlist.clear(); } #endif |
