From 23c82ec9aeaa23d20ae637ea64be87dfccb9b695 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Sun, 9 Nov 2008 04:03:17 -0600 Subject: [PATCH] Now compiles against hl2sdk-l4d as-is as well as the OB SDK still Replaced block of code that searched for a command using ICvar::GetCommands() for enumeration. Now uses ICvar::FindCommand which exists in both SDKs. --- sourcemm/episode2/vsp_listener.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sourcemm/episode2/vsp_listener.cpp b/sourcemm/episode2/vsp_listener.cpp index d3c4b27..4651c2f 100644 --- a/sourcemm/episode2/vsp_listener.cpp +++ b/sourcemm/episode2/vsp_listener.cpp @@ -213,16 +213,7 @@ bool VSPListener::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gam InitializeGlobals(interfaceFactory, interfaceFactory, interfaceFactory, pGlobals); StartupMetamod(true); - const ConCommandBase *pBase = icvar->GetCommands(); - while (pBase != NULL) - { - if (pBase->IsCommand() && strcmp(pBase->GetName(), "plugin_unload") == 0) - { - g_plugin_unload = (ConCommand *)pBase; - break; - } - pBase = pBase->GetNext(); - } + g_plugin_unload = icvar->FindCommand("plugin_unload"); if (g_plugin_unload != NULL) {