| 385 | } |
| 386 | |
| 387 | void RegisterInPlugin(CmdHook *hook) |
| 388 | { |
| 389 | PluginHookList *pList; |
| 390 | |
| 391 | IPlugin *pPlugin = scripts->FindPluginByContext(hook->pf->GetParentContext()); |
| 392 | if (!pPlugin->GetProperty("CommandList", (void **)&pList)) |
| 393 | { |
| 394 | pList = new PluginHookList(); |
| 395 | pPlugin->SetProperty("CommandList", pList); |
| 396 | } |
| 397 | |
| 398 | const char *orig = hook->info->pCmd->GetName(); |
| 399 | |
| 400 | /* Insert this into the help list, SORTED alphabetically. */ |
| 401 | PluginHookList::iterator iter = pList->begin(); |
| 402 | while (iter != pList->end()) |
| 403 | { |
| 404 | const char *cmd = (*iter)->info->pCmd->GetName(); |
| 405 | if (strcmp(orig, cmd) < 0) |
| 406 | { |
| 407 | pList->emplace(iter, hook); |
| 408 | return; |
| 409 | } |
| 410 | iter++; |
| 411 | } |
| 412 | |
| 413 | pList->emplace_back(hook); |
| 414 | } |
| 415 | |
| 416 | void ConCmdManager::AddToCmdList(ConCmdInfo *info) |
| 417 | { |
no test coverage detected