core/vsp_bridge.cpp
changeset 654 b91f45b92fe5
parent 637 b66489d8aedc
child 683 b507295429f9
     1.1 --- a/core/vsp_bridge.cpp	Mon Dec 29 11:42:44 2008 -0600
     1.2 +++ b/core/vsp_bridge.cpp	Wed Feb 25 22:40:11 2009 -0600
     1.3 @@ -34,17 +34,29 @@
     1.4  #include <loader_bridge.h>
     1.5  #include "provider/provider_ep2.h"
     1.6  
     1.7 +#if SOURCE_ENGINE >= SE_ORANGEBOX
     1.8  SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
     1.9 +#else
    1.10 +SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
    1.11 +#endif
    1.12  
    1.13  ConCommand *g_plugin_unload = NULL;
    1.14  bool g_bIsTryingToUnload;
    1.15  
    1.16 +#if SOURCE_ENGINE >= SE_ORANGEBOX
    1.17  void InterceptPluginUnloads(const CCommand &args)
    1.18 +#else
    1.19 +void InterceptPluginUnloads()
    1.20 +#endif
    1.21  {
    1.22  	g_bIsTryingToUnload = true;
    1.23  }
    1.24  
    1.25 +#if SOURCE_ENGINE >= SE_ORANGEBOX
    1.26  void InterceptPluginUnloads_Post(const CCommand &args)
    1.27 +#else
    1.28 +void InterceptPluginUnloads_Post()
    1.29 +#endif
    1.30  {
    1.31  	g_bIsTryingToUnload = false;
    1.32  }
    1.33 @@ -69,7 +81,7 @@
    1.34  		pGlobals = playerInfoManager->GetGlobalVars();
    1.35  
    1.36  		char gamedll_iface[] = "ServerGameDLL000";
    1.37 -		for (unsigned int i = 5; i <= 50; i++)
    1.38 +		for (unsigned int i = 3; i <= 50; i++)
    1.39  		{
    1.40  			gamedll_iface[15] = '0' + i;
    1.41  			if ((server = (IServerGameDLL *)info->gsFactory(gamedll_iface, NULL)) != NULL)
    1.42 @@ -107,7 +119,20 @@
    1.43  		g_Metamod.NotifyVSPListening(info->vsp_callbacks, info->vsp_version);
    1.44  		mm_StartupMetamod(true);
    1.45  		
    1.46 +#if SOURCE_ENGINE >= SE_ORANGEBOX
    1.47  		g_plugin_unload = icvar->FindCommand("plugin_unload");
    1.48 +#else
    1.49 +		const ConCommandBase *pBase = icvar->GetCommands();
    1.50 +		while (pBase != NULL)
    1.51 +		{
    1.52 +			if (pBase->IsCommand() && strcmp(pBase->GetName(), "plugin_unload") == 0)
    1.53 +			{
    1.54 +				g_plugin_unload = (ConCommand *)pBase;
    1.55 +				break;
    1.56 +			}
    1.57 +			pBase = pBase->GetNext();
    1.58 +		}
    1.59 +#endif
    1.60  
    1.61  		if (g_plugin_unload != NULL)
    1.62  		{