Use GetSourceEngineBuild() from MM:S 1.8 legacy API (bug 4083, r=ds).

This commit is contained in:
David Anderson
2009-10-29 01:33:57 -07:00
parent 5a21d8c24d
commit 8a8bafb199
4 changed files with 19 additions and 20 deletions
+12 -15
View File
@@ -438,28 +438,25 @@ static cell_t smn_IsPlayerAlive(IPluginContext *pContext, const cell_t *params)
static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
{
#if defined METAMOD_PLAPI_VERSION
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
int version = g_SMAPI->GetSourceEngineBuild();
if (version == SOURCE_ENGINE_ORIGINAL)
switch (version)
{
case SOURCE_ENGINE_ORIGINAL:
return 10;
}
else if (version == SOURCE_ENGINE_DARKMESSIAH)
{
return 15;
}
else if (version == SOURCE_ENGINE_EPISODEONE)
{
case SOURCE_ENGINE_EPISODEONE:
return 20;
}
else if (version == SOURCE_ENGINE_ORANGEBOX)
{
# if defined METAMOD_PLAPI_VERISON
/* Newer games. */
case SOURCE_ENGINE_DARKMESSIAH:
return 15;
case SOURCE_ENGINE_ORANGEBOX:
return 30;
}
else if (version == SOURCE_ENGINE_LEFT4DEAD)
{
case SOURCE_ENGINE_LEFT4DEAD:
return 40;
# endif
}
#else
if (g_HL2.IsOriginalEngine())