Add support for Valve search paths to GetFileSize native (bug 5931, r=asherkin).

This commit is contained in:
Nicholas Hastings
2014-01-07 14:24:53 -05:00
parent 310f77d96a
commit ad5740f8a7
4 changed files with 26 additions and 5 deletions
+12
View File
@@ -426,6 +426,18 @@ static cell_t sm_FileSize(IPluginContext *pContext, const cell_t *params)
return -1;
}
if (params[0] >= 2 && params[2] == 1)
{
if (smcore.filesystem->FileExists(name))
{
return smcore.filesystem->Size(name);
}
else
{
return -1;
}
}
char realpath[PLATFORM_MAX_PATH];
g_pSM->BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name);
#ifdef PLATFORM_WINDOWS