diff --git a/AMBuildScript b/AMBuildScript index 00418a1..930cbd3 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -398,6 +398,8 @@ class MMSConfig(object): if sdk.name in ['csgo', 'blade', 'pvkii'] and compiler.target.platform == 'linux': compiler.linkflags += ['-lstdc++'] + if sdk.name in ['dota', 'cs2']: + compiler.defines += ['META_IS_SOURCE2'] for path in paths: compiler.cxxincludes += [os.path.join(sdk.path, *path)] diff --git a/core/ISmmPlugin.h b/core/ISmmPlugin.h index d15dfc5..f0d185d 100644 --- a/core/ISmmPlugin.h +++ b/core/ISmmPlugin.h @@ -40,7 +40,7 @@ #include #ifndef META_NO_HL2SDK -#if SOURCE_ENGINE == SE_DOTA +#if META_IS_SOURCE2 #include #else #include diff --git a/core/gamedll_bridge.cpp b/core/gamedll_bridge.cpp index 2c6f575..0743bef 100644 --- a/core/gamedll_bridge.cpp +++ b/core/gamedll_bridge.cpp @@ -63,7 +63,7 @@ public: SourceHook::MemFuncInfo mfi; mfi.isVirtual = false; -#if SOURCE_ENGINE == SE_DOTA +#ifdef META_IS_SOURCE2 SourceHook::GetFuncInfo(&IServerGameDLL::Shutdown, mfi); #else SourceHook::GetFuncInfo(&IServerGameDLL::DLLShutdown, mfi); diff --git a/core/provider/provider_base.h b/core/provider/provider_base.h index 7e7e7ed..3092eba 100644 --- a/core/provider/provider_base.h +++ b/core/provider/provider_base.h @@ -32,7 +32,7 @@ #endif #include #include -#if SOURCE_ENGINE != SE_DOTA +#if !defined META_IS_SOURCE2 #include #endif #include "ISmmAPI.h" @@ -96,7 +96,7 @@ extern IServerGameDLL *server; extern IServerGameClients *gameclients; extern ICvar *icvar; extern CGlobalVars *gpGlobals; -#if SOURCE_ENGINE == SE_DOTA +#if defined META_IS_SOURCE2 extern INetworkServerService *netservice; extern IEngineServiceMgr *enginesvcmgr; #endif diff --git a/core/provider/source/provider_source.h b/core/provider/source/provider_source.h index 3029e80..3d80bae 100644 --- a/core/provider/source/provider_source.h +++ b/core/provider/source/provider_source.h @@ -105,7 +105,7 @@ private: bool KVLoadFromFile(KeyValues* kv, IFileSystem* filesystem, const char* resourceName, const char* pathID = nullptr); inline bool IsUserMessageIterationSupported() const { -#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV +#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV return false; #else return true;