summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp13
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: