From e4cfea72279ef0bc46e5470ddedc3de7ff7bed55 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Thu, 10 Sep 2015 20:41:27 -0400 Subject: [PATCH] Shim for TF2-branch games to find latest, non-shimmed engine iface. --- core/provider/provider_ep2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/provider/provider_ep2.cpp b/core/provider/provider_ep2.cpp index b5c2c2c..1173e03 100644 --- a/core/provider/provider_ep2.cpp +++ b/core/provider/provider_ep2.cpp @@ -108,7 +108,16 @@ void BaseProvider::ConsolePrint(const char *str) void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory, CreateInterfaceFn serverFactory) { +#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_SDK2013 + // Shim to avoid hooking shims + engine = (IVEngineServer *)((engineFactory)("VEngineServer023", NULL)); + if (!engine) + { + engine = (IVEngineServer *)((engineFactory)("VEngineServer022", NULL)); + } +#else engine = (IVEngineServer *)((engineFactory)(INTERFACEVERSION_VENGINESERVER, NULL)); +#endif if (!engine) { DisplayError("Could not find IVEngineServer! Metamod cannot load.");