1.1 --- a/core/smn_halflife.cpp Tue Oct 29 18:59:36 2013 -0400
1.2 +++ b/core/smn_halflife.cpp Tue Oct 29 19:00:21 2013 -0400
1.3 @@ -530,7 +530,23 @@
1.4
1.5 static cell_t GetEngineVersion(IPluginContext *pContext, const cell_t *params)
1.6 {
1.7 - return g_SMAPI->GetSourceEngineBuild();
1.8 + int engineVer = g_SMAPI->GetSourceEngineBuild();
1.9 +#if defined METAMOD_PLAPI_VERSION
1.10 + if (engineVer == SOURCE_ENGINE_ORANGEBOXVALVE_DEPRECATED)
1.11 + {
1.12 + const char *gamedir = g_SourceMod.GetGameFolderName();
1.13 + if (strcmp(gamedir, "tf") == 0)
1.14 + return SOURCE_ENGINE_TF2;
1.15 + else if (strcmp(gamedir, "cstrike") == 0)
1.16 + return SOURCE_ENGINE_CSS;
1.17 + else if (strcmp(gamedir, "dod") == 0)
1.18 + return SOURCE_ENGINE_DODS;
1.19 + else if (strcmp(gamedir, "hl2mp") == 0)
1.20 + return SOURCE_ENGINE_HL2DM;
1.21 + }
1.22 +#endif
1.23 +
1.24 + return engineVer;
1.25 }
1.26
1.27 static cell_t IndexToReference(IPluginContext *pContext, const cell_t *params)