sourcemm/episode1/console.cpp
branchsourcemm-1.6.0
changeset 365 afdf36dee1a6
parent 359 9b3c625f3a83
child 367 fc76472b980f
     1.1 --- a/sourcemm/episode1/console.cpp	Sat Sep 29 04:09:05 2007 +0000
     1.2 +++ b/sourcemm/episode1/console.cpp	Sat Sep 29 15:01:32 2007 +0000
     1.3 @@ -80,6 +80,37 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 +void SMConVarAccessor::UnregisterGameDLLCommands()
     1.8 +{
     1.9 +	ConCommandBase *begin = icvar->GetCommands();
    1.10 +	ConCommandBase *iter = begin;
    1.11 +	ConCommandBase *prev = NULL;
    1.12 +	while (iter)
    1.13 +	{
    1.14 +		/* Watch out for the ETERNAL COMMAND! */
    1.15 +		if (iter != &s_EternalCommand && iter->IsBitSet(FCVAR_GAMEDLL))
    1.16 +		{
    1.17 +			/* Remove it! */
    1.18 +			if (iter == begin)
    1.19 +			{
    1.20 +				s_EternalCommand.BringToFront();
    1.21 +				iter = const_cast<ConCommandBase*>(iter->GetNext());
    1.22 +				s_EternalCommand.SetNext(iter);
    1.23 +				prev = &s_EternalCommand;
    1.24 +				continue;
    1.25 +			}
    1.26 +			else
    1.27 +			{
    1.28 +				iter = const_cast<ConCommandBase*>(iter->GetNext());
    1.29 +				prev->SetNext(iter);
    1.30 +				continue;
    1.31 +			}
    1.32 +		}
    1.33 +		prev = iter;
    1.34 +		iter = const_cast<ConCommandBase*>(iter->GetNext());
    1.35 +	}
    1.36 +}
    1.37 +
    1.38  void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
    1.39  {
    1.40  	ConCommandBase *ptr = icvar->GetCommands();