From ef92966bac9035a1eead5939060b66777a70fd02 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 22 Feb 2008 17:12:24 +0000 Subject: [PATCH] added amb1402 - gameconfig errors are now logged fully --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401891 --- core/GameConfigs.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/GameConfigs.cpp b/core/GameConfigs.cpp index cb96c655..18ffaeb5 100644 --- a/core/GameConfigs.cpp +++ b/core/GameConfigs.cpp @@ -489,6 +489,7 @@ skip_find: bool CGameConfig::Reparse(char *error, size_t maxlength) { SMCError err; + SMCStates state = {0, 0}; char path[PLATFORM_MAX_PATH]; 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_pKeys); - if ((err=textparsers->ParseSMCFile(path, this, NULL, error, maxlength)) + if ((err=textparsers->ParseSMCFile(path, this, &state, error, maxlength)) != 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; }