mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Attempt reparse on stat failures and return BAD_HANDLE on error (#2253)
This commit is contained in:
parent
60d7f605cb
commit
9a03d1227f
@ -1174,7 +1174,7 @@ bool GameConfigManager::LoadGameConfigFile(const char *file, IGameConfig **_pCon
|
|||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
time_t modtime = GetFileModTime(file);
|
time_t modtime = GetFileModTime(file);
|
||||||
if (pConfig->m_ModTime != modtime)
|
if (pConfig->m_ModTime != modtime || pConfig->m_ModTime == 0)
|
||||||
{
|
{
|
||||||
pConfig->m_ModTime = modtime;
|
pConfig->m_ModTime = modtime;
|
||||||
ret = pConfig->Reparse(error, maxlength);
|
ret = pConfig->Reparse(error, maxlength);
|
||||||
|
|||||||
@ -64,7 +64,7 @@ static cell_t smn_LoadGameConfigFile(IPluginContext *pCtx, const cell_t *params)
|
|||||||
pCtx->LocalToString(params[1], &filename);
|
pCtx->LocalToString(params[1], &filename);
|
||||||
if (!g_GameConfigs.LoadGameConfigFile(filename, &gc, error, sizeof(error)))
|
if (!g_GameConfigs.LoadGameConfigFile(filename, &gc, error, sizeof(error)))
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Unable to open %s: %s", filename, error);
|
return BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle_t hndl = handlesys->CreateHandle(g_GameConfigsType, gc, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
Handle_t hndl = handlesys->CreateHandle(g_GameConfigsType, gc, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user