diff -r ab1251b273f9 -r 65250cbdb827 core/metamod.cpp --- a/core/metamod.cpp Sun Nov 23 23:22:47 2008 -0600 +++ b/core/metamod.cpp Sun Nov 23 23:45:57 2008 -0600 @@ -214,6 +214,35 @@ IFACE_MACRO(gamedll_info.factory, GameDLL); } +SMM_API void * +CreateInterface(const char *iface, int *ret) +{ + void *ptr = NULL; + + if (!mm_IsVspBridged() && strncmp(iface, "ISERVERPLUGINCALLBACKS", 22) == 0) + { + if (vsp_callbacks != NULL) + { + if (ret != NULL) + *ret = IFACE_FAILED; + return NULL; + } + + vsp_version = atoi(&iface[22]); + ptr = provider->GetVSPCallbacks(vsp_version); + + if (ptr == NULL) + vsp_version = 0; + + return ptr; + } + + if (ret) + *ret = (ptr != NULL) ? IFACE_OK : IFACE_FAILED; + + return ptr; +} + int mm_LoadPluginsFromFile(const char *_file) { @@ -500,7 +529,7 @@ "Metamod:Source Base Folder", ConVarFlag_SpOnly); - g_bIsVspBridged = true; + g_bIsVspBridged = is_vsp_load; if (!is_vsp_load) { @@ -1042,6 +1071,7 @@ void MetamodSource::NotifyVSPListening(IServerPluginCallbacks *callbacks) { + vsp_callbacks = callbacks; ITER_EVENT(OnVSPListening, (callbacks)); }