From: havoc Date: Sun, 1 Jan 2006 13:15:27 +0000 (+0000) Subject: added developer_entityparsing cvar to aid in debugging entitystring parsing issues... X-Git-Tag: xonotic-v0.1.0preview~4406 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a9412740f222db70381cc76b208400f6321b2f53;p=xonotic%2Fdarkplaces.git added developer_entityparsing cvar to aid in debugging entitystring parsing issues (which always seem to turn out to be map bugs, but it's useful to know what the bug in the map is) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5885 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host.c b/host.c index 974ce9ab..10b964c1 100644 --- a/host.c +++ b/host.c @@ -82,6 +82,7 @@ cvar_t samelevel = {0, "samelevel","0"}; cvar_t noexit = {CVAR_NOTIFY, "noexit","0"}; cvar_t developer = {0, "developer","0"}; +cvar_t developer_entityparsing = {0, "developer_entityparsing", "0"}; cvar_t skill = {0, "skill","1"}; cvar_t deathmatch = {0, "deathmatch","0"}; @@ -238,6 +239,7 @@ void Host_InitLocal (void) Cvar_RegisterVariable (&developer); if (forcedeveloper) // make it real now that the cvar is registered Cvar_SetValue("developer", 1); + Cvar_RegisterVariable (&developer_entityparsing); Cvar_RegisterVariable (&deathmatch); Cvar_RegisterVariable (&coop); diff --git a/prvm_edict.c b/prvm_edict.c index 94d74a53..1dec266c 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1009,6 +1009,7 @@ ed should be a properly initialized empty edict. Used for initial level load and for savegames. ==================== */ +extern cvar_t developer_entityparsing; const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent) { ddef_t *key; @@ -1025,6 +1026,8 @@ const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent) // parse key if (!COM_ParseToken(&data, false)) PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace"); + if (developer_entityparsing.integer) + Con_Printf("Key: \"%s\"", com_token); if (com_token[0] == '}') break; @@ -1055,6 +1058,8 @@ const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent) // parse value if (!COM_ParseToken(&data, false)) PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace"); + if (developer_entityparsing.integer) + Con_Printf(" \"%s\"\n", com_token); if (com_token[0] == '}') PRVM_ERROR ("PRVM_ED_ParseEdict: closing brace without data");