From 74aafaa72fa6c57a022ee75b6588a162f9e73d89 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 8 Feb 2013 22:46:49 -0500 Subject: [PATCH] Fixed SDKHooks looking for IServerTools on < Orangebox, causing load failure (bug 5603). --- extensions/sdkhooks/sdk/smsdk_ext.cpp | 7 ++++++- extensions/sdkhooks/sdk/smsdk_ext.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/sdkhooks/sdk/smsdk_ext.cpp b/extensions/sdkhooks/sdk/smsdk_ext.cpp index 0c73daea..bc5e544e 100644 --- a/extensions/sdkhooks/sdk/smsdk_ext.cpp +++ b/extensions/sdkhooks/sdk/smsdk_ext.cpp @@ -291,7 +291,10 @@ ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */ IVEngineServer *engine = NULL; /**< IVEngineServer pointer */ IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */ + +#if SOURCE_ENGINE >= SE_ORANGEBOX IServerTools *servertools = NULL; /**< IServerTools pointer */ +#endif /** Exposes the extension to Metamod */ SMM_API void *PL_EXPOSURE(const char *name, int *code) @@ -324,10 +327,12 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, #if !defined METAMOD_PLAPI_VERSION GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); - GET_V_IFACE_CURRENT(serverFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION); #else GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); +#endif + +#if SOURCE_ENGINE >= SE_ORANGEBOX GET_V_IFACE_CURRENT(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION); #endif diff --git a/extensions/sdkhooks/sdk/smsdk_ext.h b/extensions/sdkhooks/sdk/smsdk_ext.h index ef2faa32..55990333 100644 --- a/extensions/sdkhooks/sdk/smsdk_ext.h +++ b/extensions/sdkhooks/sdk/smsdk_ext.h @@ -301,8 +301,10 @@ extern INativeInterface *ninvoke; PLUGIN_GLOBALVARS(); extern IVEngineServer *engine; extern IServerGameDLL *gamedll; +#if SOURCE_ENGINE >= SE_ORANGEBOX extern IServerTools *servertools; #endif +#endif /** Creates a SourceMod interface macro pair */ #define SM_MKIFACE(name) SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION