MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / RemoveConCmd

Method RemoveConCmd

core/ConCmdManager.cpp:486–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486void ConCmdManager::RemoveConCmd(ConCmdInfo *info, const char *name, bool untrack)
487{
488 /* Remove from the trie */
489 m_Cmds.remove(name);
490
491 /* Remove console-specific information
492 * This should always be true as of right now
493 */
494 if (info->pCmd)
495 {
496 if (info->sourceMod)
497 {
498 /* Unlink from SourceMM */
499 g_SMAPI->UnregisterConCommandBase(g_PLAPI, info->pCmd);
500 /* Delete the command's memory */
501 char *new_help = const_cast<char *>(info->pCmd->GetHelpText());
502 char *new_name = const_cast<char *>(info->pCmd->GetName());
503 delete [] new_help;
504 delete [] new_name;
505 delete info->pCmd;
506 }
507 else
508 {
509 if (untrack)
510 UntrackConCommandBase(info->pCmd, this);
511 }
512 }
513
514 /* Remove from list */
515 m_CmdList.remove(info);
516
517 delete info;
518}
519
520bool ConCmdManager::LookForSourceModCommand(const char *cmd)
521{

Callers

nothing calls this directly

Calls 3

UntrackConCommandBaseFunction · 0.85
removeMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected