sourcemm/CSmmAPI.cpp
changeset 67 1753f7a9b2f2
parent 65 27c4d32394a6
child 76 39266faeec97
     1.1 --- a/sourcemm/CSmmAPI.cpp	Sun May 22 04:33:58 2005 +0000
     1.2 +++ b/sourcemm/CSmmAPI.cpp	Thu May 26 08:06:23 2005 +0000
     1.3 @@ -93,13 +93,27 @@
     1.4  	return static_cast<IConCommandBaseAccessor *>(&g_SMConVarAccessor);
     1.5  }
     1.6  
     1.7 -bool CSmmAPI::RegisterConCmdBase(ConCommandBase *pCommand)
     1.8 +bool CSmmAPI::RegisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand)
     1.9  {
    1.10 -	return g_SMConVarAccessor.RegisterConCommandBase(pCommand);
    1.11 +	if (pCommand->IsCommand())
    1.12 +	{
    1.13 +		g_PluginMngr.AddPluginCmd(plugin, pCommand);
    1.14 +	} else {
    1.15 +		g_PluginMngr.AddPluginCvar(plugin, pCommand);
    1.16 +	}
    1.17 +
    1.18 +	return g_SMConVarAccessor.Register(pCommand);
    1.19  }
    1.20  
    1.21 -void CSmmAPI::UnregisterConCmdBase(ConCommandBase *pCommand)
    1.22 +void CSmmAPI::UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand)
    1.23  {
    1.24 +	if (pCommand->IsCommand())
    1.25 +	{
    1.26 +		g_PluginMngr.RemovePluginCmd(plugin, pCommand);
    1.27 +	} else {
    1.28 +		g_PluginMngr.RemovePluginCvar(plugin, pCommand);
    1.29 +	}
    1.30 +
    1.31  	g_SMConVarAccessor.Unregister(pCommand);
    1.32  }
    1.33