extensions can now be built for multiple engines, and will autoload from auto.X.Y folders
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401574
This commit is contained in:
parent
d5add98082
commit
4de4797b8b
@ -405,7 +405,7 @@ void SourceModBase::DoGlobalPluginLoads()
|
|||||||
if ((game_ext = g_pGameConf->GetKeyValue("GameExtension")) != NULL)
|
if ((game_ext = g_pGameConf->GetKeyValue("GameExtension")) != NULL)
|
||||||
{
|
{
|
||||||
char path[PLATFORM_MAX_PATH];
|
char path[PLATFORM_MAX_PATH];
|
||||||
UTIL_Format(path, sizeof(path), "games/%s.ext." PLATFORM_LIB_EXT, game_ext);
|
UTIL_Format(path, sizeof(path), "%s.ext." PLATFORM_LIB_EXT, game_ext);
|
||||||
g_Extensions.LoadAutoExtension(path);
|
g_Extensions.LoadAutoExtension(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,28 @@ CExtension::CExtension(const char *filename, char *error, size_t maxlength)
|
|||||||
m_FullyLoaded = false;
|
m_FullyLoaded = false;
|
||||||
|
|
||||||
char path[PLATFORM_MAX_PATH];
|
char path[PLATFORM_MAX_PATH];
|
||||||
|
|
||||||
|
/* First see if there is an engine specific build! */
|
||||||
|
g_SourceMod.BuildPath(Path_SM,
|
||||||
|
path,
|
||||||
|
PLATFORM_MAX_PATH,
|
||||||
|
#if defined METAMOD_PLAPI_VERSION
|
||||||
|
#if defined ORANGEBOX_BUILD
|
||||||
|
"extensions/auto.2.ep2/%s",
|
||||||
|
#else
|
||||||
|
"extensions/auto.2.ep1/%s",
|
||||||
|
#endif //ORANGEBOX_BUILD
|
||||||
|
#else //METAMOD_PLAPI_VERSION
|
||||||
|
"extensions/auto.1.ep1/%s",
|
||||||
|
#endif //METAMOD_PLAPI_VERSION
|
||||||
|
filename);
|
||||||
|
|
||||||
|
/* Try the "normal" version */
|
||||||
|
if (!g_LibSys.IsPathFile(path))
|
||||||
|
{
|
||||||
g_SourceMod.BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "extensions/%s", filename);
|
g_SourceMod.BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "extensions/%s", filename);
|
||||||
|
}
|
||||||
|
|
||||||
m_Path.assign(path);
|
m_Path.assign(path);
|
||||||
|
|
||||||
m_pLib = NULL;
|
m_pLib = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user