diff --git a/core/AMBuilder b/core/AMBuilder index 9d0790e..c0bfef1 100644 --- a/core/AMBuilder +++ b/core/AMBuilder @@ -23,8 +23,7 @@ for sdk_name in MMS.sdks: 'sourcehook/sourcehook_impl_chookmaninfo.cpp', 'sourcehook/sourcehook_impl_cproto.cpp', 'sourcehook/sourcehook_impl_cvfnptr.cpp', - 'gamedll_bridge.cpp', - 'vsp_bridge.cpp' + 'gamedll_bridge.cpp' ] if sdk_name in ['dota', 'cs2']: @@ -32,7 +31,8 @@ for sdk_name in MMS.sdks: else: binary.sources += [ 'provider/source/provider_source.cpp', - 'provider/source/provider_source_console.cpp' + 'provider/source/provider_source_console.cpp', + 'vsp_bridge.cpp' ] # Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?" diff --git a/core/vsp_bridge.cpp b/core/vsp_bridge.cpp index 06c696b..40a7f35 100644 --- a/core/vsp_bridge.cpp +++ b/core/vsp_bridge.cpp @@ -34,9 +34,7 @@ #include #include "provider/provider_base.h" -#if SOURCE_ENGINE == SE_DOTA -SH_DECL_HOOK2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &); -#elif SOURCE_ENGINE >= SE_ORANGEBOX +#if SOURCE_ENGINE >= SE_ORANGEBOX SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &); #else SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false); @@ -46,9 +44,7 @@ ConCommand *g_plugin_unload = NULL; bool g_bIsTryingToUnload; SourceHook::String vsp_desc("Metamod:Source"); -#if SOURCE_ENGINE == SE_DOTA -void InterceptPluginUnloads(const CCommandContext &context, const CCommand &args) -#elif SOURCE_ENGINE >= SE_ORANGEBOX +#if SOURCE_ENGINE >= SE_ORANGEBOX void InterceptPluginUnloads(const CCommand &args) #else void InterceptPluginUnloads() @@ -57,9 +53,7 @@ void InterceptPluginUnloads() g_bIsTryingToUnload = true; } -#if SOURCE_ENGINE == SE_DOTA -void InterceptPluginUnloads_Post(const CCommandContext &context, const CCommand &args) -#elif SOURCE_ENGINE >= SE_ORANGEBOX +#if SOURCE_ENGINE >= SE_ORANGEBOX void InterceptPluginUnloads_Post(const CCommand &args) #else void InterceptPluginUnloads_Post() @@ -165,13 +159,12 @@ public: virtual void Unload() { // Source2 doesn't have the Error function (nor VSP support). -#if SOURCE_ENGINE != SE_DOTA if (g_bIsTryingToUnload) { Error("Metamod:Source cannot be unloaded from VSP mode. Use \"meta unload\" to unload specific plugins.\n"); return; } -#endif + if (g_plugin_unload != NULL) { SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_plugin_unload, InterceptPluginUnloads, false);