| 484 | } |
| 485 | |
| 486 | void 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 | |
| 520 | bool ConCmdManager::LookForSourceModCommand(const char *cmd) |
| 521 | { |
nothing calls this directly
no test coverage detected