mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-01-30 19:52:17 +01:00
amb298 - SourceMM wasn't loaded as VSP using a relative path on Linux
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40403
This commit is contained in:
parent
8de5ef248f
commit
8f6e916a45
@ -456,6 +456,7 @@ void CSmmAPI::LoadAsVSP()
|
||||
{
|
||||
size_t len;
|
||||
char engine_file[PATH_SIZE];
|
||||
char engine_path[PATH_SIZE];
|
||||
char rel_path[PATH_SIZE * 2];
|
||||
|
||||
GetFileOfAddress(g_Engine.engine, engine_file, sizeof(engine_file));
|
||||
@ -471,9 +472,10 @@ void CSmmAPI::LoadAsVSP()
|
||||
break;
|
||||
}
|
||||
}
|
||||
abspath(engine_path, engine_file);
|
||||
|
||||
const char *usepath = g_SmmPath.c_str();
|
||||
if (UTIL_Relatize(rel_path, sizeof(rel_path), engine_file, g_SmmPath.c_str()))
|
||||
if (UTIL_Relatize(rel_path, sizeof(rel_path), engine_path, g_SmmPath.c_str()))
|
||||
{
|
||||
usepath = rel_path;
|
||||
}
|
||||
|
@ -240,6 +240,19 @@ size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
|
||||
return len;
|
||||
}
|
||||
|
||||
size_t UTIL_FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list params)
|
||||
{
|
||||
size_t len = vsnprintf(buffer, maxlength, fmt, params);
|
||||
|
||||
if (len >= maxlength)
|
||||
{
|
||||
len = maxlength - 1;
|
||||
buffer[len] = '\0';
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
inline bool pathchar_isalpha(char a)
|
||||
{
|
||||
return (((a & 1<<7) == 0) && isalpha(a));
|
||||
@ -393,16 +406,3 @@ bool UTIL_Relatize(char buffer[],
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t UTIL_FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list params)
|
||||
{
|
||||
size_t len = vsnprintf(buffer, maxlength, fmt, params);
|
||||
|
||||
if (len >= maxlength)
|
||||
{
|
||||
len = maxlength - 1;
|
||||
buffer[len] = '\0';
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user