Skip to content

Commit

Permalink
Attempt reparse on stat failures and return BAD_HANDLE on error (#2253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Headline authored Jan 31, 2025
1 parent 60d7f60 commit 9a03d12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/logic/GameConfigs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/logic/smn_gameconfigs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a03d12

Please sign in to comment.