diff --git a/core-legacy/CSmmAPI.cpp b/core-legacy/CSmmAPI.cpp index e104452..5e7388f 100644 --- a/core-legacy/CSmmAPI.cpp +++ b/core-legacy/CSmmAPI.cpp @@ -646,3 +646,8 @@ IServerPluginCallbacks *CSmmAPI::GetVSPInfo(int *pVersion) return g_pRealVspCallbacks; } + +int CSmmAPI::GetSourceEngineBuild() +{ + return g_Engine.original ? SOURCE_ENGINE_ORIGINAL : SOURCE_ENGINE_EPISODEONE; +} diff --git a/core-legacy/CSmmAPI.h b/core-legacy/CSmmAPI.h index afbba21..95cb6df 100644 --- a/core-legacy/CSmmAPI.h +++ b/core-legacy/CSmmAPI.h @@ -71,6 +71,7 @@ namespace SourceMM int GetUserMessageCount(); int FindUserMessage(const char *name, int *size=NULL); const char *GetUserMessage(int index, int *size=NULL); + int GetSourceEngineBuild(); public: bool CacheCmds(); bool CmdCacheSuccessful(); diff --git a/core-legacy/ISmmAPI.h b/core-legacy/ISmmAPI.h index 93a7ea5..e56af16 100644 --- a/core-legacy/ISmmAPI.h +++ b/core-legacy/ISmmAPI.h @@ -35,6 +35,10 @@ class ISmmPlugin; #define MMIFACE_PLMANAGER "IPluginManager" /**< SourceMM Plugin Functions */ #define IFACE_MAXNUM 999 +#define SOURCE_ENGINE_UNKNOWN 0 /**< Could not determine the engine version */ +#define SOURCE_ENGINE_ORIGINAL 1 /**< Original Source Engine (used by The Ship) */ +#define SOURCE_ENGINE_EPISODEONE 2 /**< Episode 1 Source Engine (second major SDK) */ + class ISmmAPI { public: @@ -316,6 +320,17 @@ public: // Added in 1.4 (1:5) * EnableVSPListener(). */ virtual IServerPluginCallbacks *GetVSPInfo(int *pVersion) =0; + + /** + * @brief Returns the engine interface that MM:S is using as a backend. + * + * The values will be one of the SOURCE_ENGINE_* constants from the top + * of this file. + * + * @return A SOURCE_ENGINE_* constant value. + */ + virtual int GetSourceEngineBuild() =0; + };