mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Module priority 'shuffler' suggestion from Phoenix, needs some testing but works ok for him
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9933 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
8a3bcebffc
commit
20b31c2b68
@ -332,7 +332,14 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s,
|
||||
|
||||
/* Do we need to swap? */
|
||||
if (swap && (swap_pos != source))
|
||||
std::swap(EventHandlers[i][swap_pos], EventHandlers[i][source]);
|
||||
{
|
||||
/* Suggestion from Phoenix, "shuffle" the modules to better retain call order */
|
||||
int incrmnt = 1;
|
||||
if (source > swap_pos)
|
||||
incrmnt = -1;
|
||||
for (unsigned int j = source; j != swap_pos; j += incrmnt)
|
||||
std::swap(EventHandlers[i][j], EventHandlers[i][j+incrmnt]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user