1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

Backported GetSourceEngineBuild from new API to legacy API (bug 4082, r=ds).

This commit is contained in:
David Anderson 2009-10-29 01:12:10 -07:00
parent e93bd0fdbb
commit 88974ed0b5
3 changed files with 21 additions and 0 deletions

View File

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

View File

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

View File

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