1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-11-28 10:24:20 +01:00

Add and use META_IS_SOURCE2 define

This commit is contained in:
Nick Hastings 2023-05-16 14:31:31 -04:00
parent acd8644688
commit d62379244c
5 changed files with 7 additions and 5 deletions

View File

@ -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)]

View File

@ -40,7 +40,7 @@
#include <ISmmPluginExt.h>
#ifndef META_NO_HL2SDK
#if SOURCE_ENGINE == SE_DOTA
#if META_IS_SOURCE2
#include <interfaces/interfaces.h>
#else
#include <tier1/interface.h>

View File

@ -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);

View File

@ -32,7 +32,7 @@
#endif
#include <sourcehook.h>
#include <sh_memfuncinfo.h>
#if SOURCE_ENGINE != SE_DOTA
#if !defined META_IS_SOURCE2
#include <iserverplugin.h>
#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

View File

@ -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;