Replace the AddRootConsoleCommand API to not expose internal structures.

This commit is contained in:
David Anderson
2015-08-30 21:01:03 -07:00
parent e992c33f35
commit 9d805ea9fb
16 changed files with 83 additions and 90 deletions
+5 -5
View File
@@ -134,7 +134,7 @@ void ConVarManager::OnSourceModAllInitialized()
scripts->AddPluginsListener(this);
/* Add the 'convars' option to the 'sm' console command */
g_RootMenu.AddRootConsoleCommand("cvars", "View convars created by a plugin", this);
g_RootMenu.AddRootConsoleCommand3("cvars", "View convars created by a plugin", this);
}
void ConVarManager::OnSourceModShutdown()
@@ -340,19 +340,19 @@ bool ConVarManager::GetHandleApproxSize(HandleType_t type, void *object, unsigne
return true;
}
void ConVarManager::OnRootConsoleCommand(const char *cmdname, const CCommand &command)
void ConVarManager::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *command)
{
int argcount = command.ArgC();
int argcount = command->ArgC();
if (argcount >= 3)
{
bool wantReset = false;
/* Get plugin index that was passed */
const char *arg = command.Arg(2);
const char *arg = command->Arg(2);
if (argcount >= 4 && strcmp(arg, "reset") == 0)
{
wantReset = true;
arg = command.Arg(3);
arg = command->Arg(3);
}
/* Get plugin object */