diff -r 30ac566e3e94 -r afdf36dee1a6 sourcemm/episode1/console.cpp --- a/sourcemm/episode1/console.cpp Sat Sep 29 04:09:05 2007 +0000 +++ b/sourcemm/episode1/console.cpp Sat Sep 29 15:01:32 2007 +0000 @@ -80,6 +80,37 @@ } } +void SMConVarAccessor::UnregisterGameDLLCommands() +{ + ConCommandBase *begin = icvar->GetCommands(); + ConCommandBase *iter = begin; + ConCommandBase *prev = NULL; + while (iter) + { + /* Watch out for the ETERNAL COMMAND! */ + if (iter != &s_EternalCommand && iter->IsBitSet(FCVAR_GAMEDLL)) + { + /* Remove it! */ + if (iter == begin) + { + s_EternalCommand.BringToFront(); + iter = const_cast(iter->GetNext()); + s_EternalCommand.SetNext(iter); + prev = &s_EternalCommand; + continue; + } + else + { + iter = const_cast(iter->GetNext()); + prev->SetNext(iter); + continue; + } + } + prev = iter; + iter = const_cast(iter->GetNext()); + } +} + void SMConVarAccessor::Unregister(ConCommandBase *pCommand) { ConCommandBase *ptr = icvar->GetCommands();