Skip to content

Commit 9a03d12

Browse files
authored
Attempt reparse on stat failures and return BAD_HANDLE on error (#2253)
1 parent 60d7f60 commit 9a03d12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/logic/GameConfigs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ bool GameConfigManager::LoadGameConfigFile(const char *file, IGameConfig **_pCon
11741174
{
11751175
bool ret = true;
11761176
time_t modtime = GetFileModTime(file);
1177-
if (pConfig->m_ModTime != modtime)
1177+
if (pConfig->m_ModTime != modtime || pConfig->m_ModTime == 0)
11781178
{
11791179
pConfig->m_ModTime = modtime;
11801180
ret = pConfig->Reparse(error, maxlength);

core/logic/smn_gameconfigs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static cell_t smn_LoadGameConfigFile(IPluginContext *pCtx, const cell_t *params)
6464
pCtx->LocalToString(params[1], &filename);
6565
if (!g_GameConfigs.LoadGameConfigFile(filename, &gc, error, sizeof(error)))
6666
{
67-
return pCtx->ThrowNativeError("Unable to open %s: %s", filename, error);
67+
return BAD_HANDLE;
6868
}
6969

7070
Handle_t hndl = handlesys->CreateHandle(g_GameConfigsType, gc, pCtx->GetIdentity(), g_pCoreIdent, NULL);

0 commit comments

Comments
 (0)