diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-04 16:50:50 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-04 16:50:50 +0000 |
commit | 9b131bef322a4ed592d53e8c8eec8759287944a5 (patch) | |
tree | d00bedc6e1211c98571a865910ddca4529bc8479 /src/modules.cpp | |
parent | f6bd92ab87208b104baba2eaa99236d0b03d8552 (diff) |
More craq
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8507 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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: |