mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-07 01:54:19 +01:00
Fixed bug where plugin aliases defined in VDF files on core (Orange Box and L4D engines) didn't work.
This commit is contained in:
parent
fde79ae26d
commit
774af58103
@ -1114,7 +1114,7 @@ ProcessVDF(const char *path, bool &skipped)
|
|||||||
{
|
{
|
||||||
PluginId id;
|
PluginId id;
|
||||||
bool already;
|
bool already;
|
||||||
char alias[24], file[255], error[255];
|
char alias[24], file[255], full_path[255], error[255];
|
||||||
|
|
||||||
if (!provider->ProcessVDF(path, file, sizeof(file), alias, sizeof(alias)))
|
if (!provider->ProcessVDF(path, file, sizeof(file), alias, sizeof(alias)))
|
||||||
{
|
{
|
||||||
@ -1125,7 +1125,31 @@ ProcessVDF(const char *path, bool &skipped)
|
|||||||
if (alias[0] != '\0')
|
if (alias[0] != '\0')
|
||||||
g_PluginMngr.SetAlias(alias, file);
|
g_PluginMngr.SetAlias(alias, file);
|
||||||
|
|
||||||
id = g_PluginMngr.Load(file, Pl_File, already, error, sizeof(error));
|
/* Attempt to find a file extension */
|
||||||
|
if (UTIL_GetExtension(file) == NULL)
|
||||||
|
{
|
||||||
|
g_pMetamod->PathFormat(full_path,
|
||||||
|
sizeof(full_path),
|
||||||
|
"%s/%s%s",
|
||||||
|
g_pMetamod->GetBaseDir(),
|
||||||
|
file,
|
||||||
|
#if defined WIN32 || defined _WIN32
|
||||||
|
".dll"
|
||||||
|
#else
|
||||||
|
"_i486.so"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pMetamod->PathFormat(full_path,
|
||||||
|
sizeof(full_path),
|
||||||
|
"%s/%s",
|
||||||
|
g_pMetamod->GetBaseDir(),
|
||||||
|
file);
|
||||||
|
}
|
||||||
|
|
||||||
|
id = g_PluginMngr.Load(full_path, Pl_File, already, error, sizeof(error));
|
||||||
skipped = already;
|
skipped = already;
|
||||||
if (id < Pl_MinId || g_PluginMngr.FindById(id)->m_Status < Pl_Paused)
|
if (id < Pl_MinId || g_PluginMngr.FindById(id)->m_Status < Pl_Paused)
|
||||||
{
|
{
|
||||||
|
@ -417,6 +417,8 @@ bool BaseProvider::ProcessVDF(const char *file, char path[], size_t path_len, ch
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UTIL_Format(path, path_len, "%s", plugin_file);
|
||||||
|
|
||||||
if ((p_alias = pValues->GetString("alias", NULL)) != NULL)
|
if ((p_alias = pValues->GetString("alias", NULL)) != NULL)
|
||||||
{
|
{
|
||||||
UTIL_Format(alias, alias_len, "%s", p_alias);
|
UTIL_Format(alias, alias_len, "%s", p_alias);
|
||||||
@ -426,30 +428,6 @@ bool BaseProvider::ProcessVDF(const char *file, char path[], size_t path_len, ch
|
|||||||
UTIL_Format(alias, alias_len, "");
|
UTIL_Format(alias, alias_len, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to find a file extension */
|
|
||||||
if (UTIL_GetExtension(plugin_file) == NULL)
|
|
||||||
{
|
|
||||||
g_pMetamod->PathFormat(path,
|
|
||||||
path_len,
|
|
||||||
"%s/%s%s",
|
|
||||||
g_pMetamod->GetBaseDir(),
|
|
||||||
plugin_file,
|
|
||||||
#if defined WIN32 || defined _WIN32
|
|
||||||
".dll"
|
|
||||||
#else
|
|
||||||
"_i486.so"
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_pMetamod->PathFormat(path,
|
|
||||||
path_len,
|
|
||||||
"%s/%s",
|
|
||||||
g_pMetamod->GetBaseDir(),
|
|
||||||
plugin_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
pValues->deleteThis();
|
pValues->deleteThis();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user