]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Merge pull request #1157 from SaberUK/insp20+fix-cron-restart
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index 23094ddc55f0a4c4557aba85248513d48c87f12d..b29c58240689be37d9e86a4d8be12193c860ef11 100644 (file)
@@ -38,12 +38,14 @@ class ModuleBotMode : public Module
        ModuleBotMode()
                : bm(this)
        {
-               if (!ServerInstance->Modes->AddMode(&bm))
-                       throw ModuleException("Could not add new modes!");
-               Implementation eventlist[] = { I_OnWhois };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
+       void init()
+       {
+               ServerInstance->Modules->AddService(bm);
+               Implementation eventlist[] = { I_OnWhois };
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
+       }
 
        virtual ~ModuleBotMode()
        {