]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added developer_entityparsing cvar to aid in debugging entitystring parsing issues...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Jan 2006 13:15:27 +0000 (13:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Jan 2006 13:15:27 +0000 (13:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5885 d7cf8633-e32d-0410-b094-e92efae38249

host.c
prvm_edict.c

diff --git a/host.c b/host.c
index 974ce9ab7625f5b77ae491c972e014e4bc15d1cf..10b964c17a9e192f4cb39f2927c19445c5331074 100644 (file)
--- 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);
 
index 94d74a53be86fa6ac61dea41d4ba646ae8d4a4fe..1dec266c4363d3fba4b52455a9f21e0a3a45fb3c 100644 (file)
@@ -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");