added amb1402 - gameconfig errors are now logged fully
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401891
This commit is contained in:
parent
1f57da5aa0
commit
ef92966bac
@ -489,6 +489,7 @@ skip_find:
|
|||||||
bool CGameConfig::Reparse(char *error, size_t maxlength)
|
bool CGameConfig::Reparse(char *error, size_t maxlength)
|
||||||
{
|
{
|
||||||
SMCError err;
|
SMCError err;
|
||||||
|
SMCStates state = {0, 0};
|
||||||
|
|
||||||
char path[PLATFORM_MAX_PATH];
|
char path[PLATFORM_MAX_PATH];
|
||||||
g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s.txt", m_pFile);
|
g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s.txt", m_pFile);
|
||||||
@ -508,9 +509,19 @@ bool CGameConfig::Reparse(char *error, size_t maxlength)
|
|||||||
sm_trie_clear(m_pProps);
|
sm_trie_clear(m_pProps);
|
||||||
sm_trie_clear(m_pKeys);
|
sm_trie_clear(m_pKeys);
|
||||||
|
|
||||||
if ((err=textparsers->ParseSMCFile(path, this, NULL, error, maxlength))
|
if ((err=textparsers->ParseSMCFile(path, this, &state, error, maxlength))
|
||||||
!= SMCError_Okay)
|
!= SMCError_Okay)
|
||||||
{
|
{
|
||||||
|
const char *msg;
|
||||||
|
|
||||||
|
msg = textparsers->GetSMCErrorString(err);
|
||||||
|
|
||||||
|
g_Logger.LogError("[SM] Error parsing gameconfig file \"%s\":", path);
|
||||||
|
g_Logger.LogError("[SM] Error %d on line %d, col %d: %s",
|
||||||
|
err,
|
||||||
|
state.line,
|
||||||
|
state.col,
|
||||||
|
msg ? msg : "Unknown error");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user