]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Renumber the implement lists after a module is unloaded
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 4 Jan 2006 23:05:56 +0000 (23:05 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 4 Jan 2006 23:05:56 +0000 (23:05 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2734 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp

index e778370a580efe36e8cec7b6fae58e38ab2cc5c4..2df5b8688200f44bcfd6667265eda93706fc8895 100644 (file)
@@ -315,8 +315,15 @@ bool InspIRCd::UnloadModule(const char* filename)
                                Config->global_implementation[t] -= Config->implement_lists[j][t];
                        }
 
-                       /* TODO: We have to renumber implement_lists after unload because the module numbers change!
+                       /* We have to renumber implement_lists after unload because the module numbers change!
                         */
+                       for(int j2 = j; j2 < 254; j2++)
+                       {
+                               for(int t = 0; t < 255; t++)
+                               {
+                                       Config->implement_lists[j2][t] = Config->implement_lists[j2+1][t];
+                               }
+                       }
 
                        FOREACH_MOD(I_OnUnloadModule,OnUnloadModule(modules[j],Config->module_names[j]));
                        // found the module