mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +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;
|
||||
time_t modtime = GetFileModTime(file);
|
||||
if (pConfig->m_ModTime != modtime)
|
||||
if (pConfig->m_ModTime != modtime || pConfig->m_ModTime == 0)
|
||||
{
|
||||
pConfig->m_ModTime = modtime;
|
||||
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);
|
||||
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user