1.1 --- a/core/smn_halflife.cpp Thu Oct 29 00:53:31 2009 -0700
1.2 +++ b/core/smn_halflife.cpp Thu Oct 29 01:33:57 2009 -0700
1.3 @@ -438,28 +438,25 @@
1.4
1.5 static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
1.6 {
1.7 -#if defined METAMOD_PLAPI_VERSION
1.8 +#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
1.9 int version = g_SMAPI->GetSourceEngineBuild();
1.10
1.11 - if (version == SOURCE_ENGINE_ORIGINAL)
1.12 - {
1.13 - return 10;
1.14 - }
1.15 - else if (version == SOURCE_ENGINE_DARKMESSIAH)
1.16 - {
1.17 - return 15;
1.18 - }
1.19 - else if (version == SOURCE_ENGINE_EPISODEONE)
1.20 + switch (version)
1.21 {
1.22 + case SOURCE_ENGINE_ORIGINAL:
1.23 + return 10;
1.24 + case SOURCE_ENGINE_EPISODEONE:
1.25 return 20;
1.26 - }
1.27 - else if (version == SOURCE_ENGINE_ORANGEBOX)
1.28 - {
1.29 +
1.30 +# if defined METAMOD_PLAPI_VERISON
1.31 + /* Newer games. */
1.32 + case SOURCE_ENGINE_DARKMESSIAH:
1.33 + return 15;
1.34 + case SOURCE_ENGINE_ORANGEBOX:
1.35 return 30;
1.36 - }
1.37 - else if (version == SOURCE_ENGINE_LEFT4DEAD)
1.38 - {
1.39 + case SOURCE_ENGINE_LEFT4DEAD:
1.40 return 40;
1.41 +# endif
1.42 }
1.43 #else
1.44 if (g_HL2.IsOriginalEngine())