rewrote how new menus are detected -- menucmds are no longer used since they're idiotic anyway

This commit is contained in:
David Anderson
2007-04-25 14:44:37 +00:00
parent 3b80342a02
commit d682375d7d
3 changed files with 74 additions and 62 deletions

View File

@@ -150,8 +150,23 @@ int MenuMngr::registerMenuId(const char* n, AMX* a)
void MenuMngr::registerMenuCmd(CPluginMngr::CPlugin *a, int mi, int k, int f, int n)
{
MenuCommand** temp = &headcmd;
while (*temp) temp = &(*temp)->next;
MenuCommand **temp = &headcmd;
MenuCommand *ptr;
while (*temp)
{
ptr = *temp;
if (n > -1
&& ptr->plugin == a
&& ptr->menuid == mi
&& ptr->keys == k)
{
if (strcmp(g_forwards.getFuncName(ptr->function), g_forwards.getFuncName(f)) == 0)
{
return;
}
}
temp = &(*temp)->next;
}
*temp = new MenuCommand(a, mi, k, f, n);
}