Permalink
Browse files

Merge pull request #17 from alliedmodders/shim-noshim

Shim for TF2-branch games to find latest, non-shimmed engine iface.
  • Loading branch information...
psychonic committed Sep 11, 2015
1 parent 05ae15c commit fa9ba7859f4ac5035efd643b4f61f4da9e7d2993
Showing with 9 additions and 0 deletions.
  1. +9 −0 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.");

0 comments on commit fa9ba78

Please sign in to comment.