From 9b131bef322a4ed592d53e8c8eec8759287944a5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Nov 2007 16:50:50 +0000 Subject: More craq git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8507 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index ae6767765..3a916e8a6 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -231,21 +231,32 @@ void ModuleManager::DetachAll(Module* mod) Detach((Implementation)n, mod); } +bool ModuleManager::SetPriority(Module* mod, PriorityState s) +{ + for (size_t n = I_BEGIN + 1; n != I_END; ++n) + SetPriority(mod, (Implementation)n, s); +} + bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s, Module** modules, size_t sz) { size_t swap_pos; - size_t source; + size_t source = 0; bool swap = true; + bool found = false; for (size_t x = 0; x != EventHandlers[i].size(); ++x) { if (EventHandlers[i][x] == mod) { source = x; + found = true; break; } } + if (!found) + return false; + switch (s) { case PRIO_DONTCARE: -- cgit v1.2.3