core/ConCmdManager.cpp
changeset 2400 76b7b4575e21
parent 2289 44045ead61cd
child 2546 32c1d07b2038
     1.1 --- a/core/ConCmdManager.cpp	Fri Nov 14 03:38:59 2008 -0600
     1.2 +++ b/core/ConCmdManager.cpp	Fri Nov 14 09:18:30 2008 -0600
     1.3 @@ -40,7 +40,7 @@
     1.4  
     1.5  ConCmdManager g_ConCmds;
     1.6  
     1.7 -#if defined ORANGEBOX_BUILD
     1.8 +#if SOURCE_ENGINE >= SE_ORANGEBOX
     1.9  	SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
    1.10  #else
    1.11  	SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
    1.12 @@ -205,7 +205,7 @@
    1.13  		delete pList;
    1.14  	}
    1.15  }
    1.16 -#if defined ORANGEBOX_BUILD
    1.17 +#if SOURCE_ENGINE >= SE_ORANGEBOX
    1.18  void CommandCallback(const CCommand &command)
    1.19  {
    1.20  #else
    1.21 @@ -515,7 +515,7 @@
    1.22  		return true;
    1.23  	}
    1.24  
    1.25 -	edict_t *pEdict = engine->PEntityOfEntIndex(client);
    1.26 +	edict_t *pEdict = PEntityOfEntIndex(client);
    1.27  	
    1.28  	/* If we got here, the command failed... */
    1.29  	char buffer[128];
    1.30 @@ -897,23 +897,7 @@
    1.31  	{
    1.32  		pInfo = new ConCmdInfo();
    1.33  		/* Find the commandopan */
    1.34 -		ConCommandBase *pBase = icvar->GetCommands();
    1.35 -		ConCommand *pCmd = NULL;
    1.36 -		while (pBase)
    1.37 -		{
    1.38 -			if (strcmp(pBase->GetName(), name) == 0)
    1.39 -			{
    1.40 -				/* Don't want to return convar with same name */
    1.41 -				if (!pBase->IsCommand())
    1.42 -				{
    1.43 -					return NULL;
    1.44 -				}
    1.45 -
    1.46 -				pCmd = (ConCommand *)pBase;
    1.47 -				break;
    1.48 -			}
    1.49 -			pBase = const_cast<ConCommandBase *>(pBase->GetNext());
    1.50 -		}
    1.51 +		ConCommand *pCmd = FindCommand(name);
    1.52  
    1.53  		if (!pCmd)
    1.54  		{