changed most COM_ParseToken calls to COM_ParseTokenConsole, this fixed the kills...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 7 Jul 2006 04:19:55 +0000 (04:19 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 7 Jul 2006 04:19:55 +0000 (04:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6502 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
console.c
host_cmd.c
menu.c
model_brush.c
prvm_cmds.c
prvm_edict.c
r_shadow.c

index ae542ba..e9ef9b4 100644 (file)
@@ -315,13 +315,13 @@ void CL_ParseEntityLump(char *entdata)
        data = entdata;
        if (!data)
                return;
-       if (!COM_ParseToken(&data, false))
+       if (!COM_ParseTokenConsole(&data))
                return; // error
        if (com_token[0] != '{')
                return; // error
        while (1)
        {
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        return; // error
                if (com_token[0] == '}')
                        break; // end of worldspawn
@@ -331,7 +331,7 @@ void CL_ParseEntityLump(char *entdata)
                        strlcpy (key, com_token, sizeof (key));
                while (key[strlen(key)-1] == ' ') // remove trailing spaces
                        key[strlen(key)-1] = 0;
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        return; // error
                strlcpy (value, com_token, sizeof (value));
                if (!strcmp("sky", key))
index e68ca4f..c244706 100644 (file)
--- a/console.c
+++ b/console.c
@@ -977,7 +977,7 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                for (;;)
                                {
                                        int l;
-                                       if (!COM_ParseToken(&data, false))
+                                       if (!COM_ParseTokenConsole(&data))
                                                break;
                                        if (com_token[0] == '{')
                                                continue;
@@ -988,7 +988,7 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                        for (l = 0;l < (int)sizeof(keyname) - 1 && com_token[k+l] && com_token[k+l] > ' ';l++)
                                                keyname[l] = com_token[k+l];
                                        keyname[l] = 0;
-                                       if (!COM_ParseToken(&data, false))
+                                       if (!COM_ParseTokenConsole(&data))
                                                break;
                                        if (developer.integer >= 100)
                                                Con_Printf("key: %s %s\n", keyname, com_token);
index 5f1569a..ebfd6d4 100644 (file)
@@ -631,7 +631,7 @@ void Host_Loadgame_f (void)
        }
 
        // version
-       COM_ParseToken(&t, false);
+       COM_ParseTokenConsole(&t);
        version = atoi(com_token);
        if (version != SAVEGAME_VERSION)
        {
@@ -647,21 +647,21 @@ void Host_Loadgame_f (void)
 
        for (i = 0;i < NUM_SPAWN_PARMS;i++)
        {
-               COM_ParseToken(&t, false);
+               COM_ParseTokenConsole(&t);
                spawn_parms[i] = atof(com_token);
        }
        // skill
-       COM_ParseToken(&t, false);
+       COM_ParseTokenConsole(&t);
 // this silliness is so we can load 1.06 save files, which have float skill values
        current_skill = (int)(atof(com_token) + 0.5);
        Cvar_SetValue ("skill", (float)current_skill);
 
        // mapname
-       COM_ParseToken(&t, false);
+       COM_ParseTokenConsole(&t);
        strcpy (mapname, com_token);
 
        // time
-       COM_ParseToken(&t, false);
+       COM_ParseTokenConsole(&t);
        time = atof(com_token);
 
        allowcheats = sv_cheats.integer != 0;
@@ -682,7 +682,7 @@ void Host_Loadgame_f (void)
        {
                // light style
                oldt = t;
-               COM_ParseToken(&t, false);
+               COM_ParseTokenConsole(&t);
                // if this is a 64 lightstyle savegame produced by Quake, stop now
                // we have to check this because darkplaces saves 256 lightstyle savegames
                if (com_token[0] == '{')
@@ -700,7 +700,7 @@ void Host_Loadgame_f (void)
        for(;;)
        {
                oldt = t;
-               COM_ParseToken(&t, false);
+               COM_ParseTokenConsole(&t);
                if (com_token[0] == '{')
                {
                        t = oldt;
@@ -715,10 +715,10 @@ void Host_Loadgame_f (void)
        for (;;)
        {
                start = t;
-               while (COM_ParseToken(&t, false))
+               while (COM_ParseTokenConsole(&t))
                        if (!strcmp(com_token, "}"))
                                break;
-               if (!COM_ParseToken(&start, false))
+               if (!COM_ParseTokenConsole(&start))
                {
                        // end of file
                        break;
@@ -1582,7 +1582,7 @@ void Host_Kick_f (void)
                if (Cmd_Argc() > 2)
                {
                        message = Cmd_Args();
-                       COM_ParseToken(&message, false);
+                       COM_ParseTokenConsole(&message);
                        if (byNumber)
                        {
                                message++;                                                      // skip the #
diff --git a/menu.c b/menu.c
index abc4a74..66f228c 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -891,10 +891,10 @@ static void M_ScanSaves (void)
                buf[sizeof(buf) - 1] = 0;
                t = buf;
                // version
-               COM_ParseToken(&t, false);
+               COM_ParseTokenConsole(&t);
                version = atoi(com_token);
                // description
-               COM_ParseToken(&t, false);
+               COM_ParseTokenConsole(&t);
                strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
 
        // change _ back to space
index 937924f..32c49f6 100644 (file)
@@ -1639,13 +1639,13 @@ static void Mod_Q1BSP_ParseWadsFromEntityLump(const char *data)
        int i, j, k;
        if (!data)
                return;
-       if (!COM_ParseToken(&data, false))
+       if (!COM_ParseTokenConsole(&data))
                return; // error
        if (com_token[0] != '{')
                return; // error
        while (1)
        {
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        return; // error
                if (com_token[0] == '}')
                        break; // end of worldspawn
@@ -1655,7 +1655,7 @@ static void Mod_Q1BSP_ParseWadsFromEntityLump(const char *data)
                        strcpy(key, com_token);
                while (key[strlen(key)-1] == ' ') // remove trailing spaces
                        key[strlen(key)-1] = 0;
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        return; // error
                dpsnprintf(value, sizeof(value), "%s", com_token);
                if (!strcmp("wad", key)) // for HalfLife maps
@@ -2503,12 +2503,12 @@ static void Mod_Q1BSP_LoadMapBrushes(void)
        if (!maptext)
                return;
        text = maptext;
-       if (!COM_ParseToken(&data, false))
+       if (!COM_ParseTokenConsole(&data))
                return; // error
        submodel = 0;
        for (;;)
        {
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        break;
                if (com_token[0] != '{')
                        return; // error
@@ -2519,7 +2519,7 @@ static void Mod_Q1BSP_LoadMapBrushes(void)
                brushes = Mem_Alloc(loadmodel->mempool, maxbrushes * sizeof(mbrush_t));
                for (;;)
                {
-                       if (!COM_ParseToken(&data, false))
+                       if (!COM_ParseTokenConsole(&data))
                                return; // error
                        if (com_token[0] == '}')
                                break; // end of entity
@@ -2543,7 +2543,7 @@ static void Mod_Q1BSP_LoadMapBrushes(void)
                                }
                                for (;;)
                                {
-                                       if (!COM_ParseToken(&data, false))
+                                       if (!COM_ParseTokenConsole(&data))
                                                return; // error
                                        if (com_token[0] == '}')
                                                break; // end of brush
@@ -2552,25 +2552,25 @@ static void Mod_Q1BSP_LoadMapBrushes(void)
                                        // FIXME: support hl .map format
                                        for (pointnum = 0;pointnum < 3;pointnum++)
                                        {
-                                               COM_ParseToken(&data, false);
+                                               COM_ParseTokenConsole(&data);
                                                for (componentnum = 0;componentnum < 3;componentnum++)
                                                {
-                                                       COM_ParseToken(&data, false);
+                                                       COM_ParseTokenConsole(&data);
                                                        point[pointnum][componentnum] = atof(com_token);
                                                }
-                                               COM_ParseToken(&data, false);
+                                               COM_ParseTokenConsole(&data);
                                        }
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        strlcpy(facetexture, com_token, sizeof(facetexture));
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        //scroll_s = atof(com_token);
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        //scroll_t = atof(com_token);
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        //rotate = atof(com_token);
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        //scale_s = atof(com_token);
-                                       COM_ParseToken(&data, false);
+                                       COM_ParseTokenConsole(&data);
                                        //scale_t = atof(com_token);
                                        TriangleNormal(point[0], point[1], point[2], planenormal);
                                        VectorNormalizeDouble(planenormal);
@@ -3908,11 +3908,11 @@ static void Mod_Q3BSP_LoadEntities(lump_t *l)
        memcpy(loadmodel->brush.entities, mod_base + l->fileofs, l->filelen);
        data = loadmodel->brush.entities;
        // some Q3 maps override the lightgrid_cellsize with a worldspawn key
-       if (data && COM_ParseToken(&data, false) && com_token[0] == '{')
+       if (data && COM_ParseTokenConsole(&data) && com_token[0] == '{')
        {
                while (1)
                {
-                       if (!COM_ParseToken(&data, false))
+                       if (!COM_ParseTokenConsole(&data))
                                break; // error
                        if (com_token[0] == '}')
                                break; // end of worldspawn
@@ -3922,7 +3922,7 @@ static void Mod_Q3BSP_LoadEntities(lump_t *l)
                                strcpy(key, com_token);
                        while (key[strlen(key)-1] == ' ') // remove trailing spaces
                                key[strlen(key)-1] = 0;
-                       if (!COM_ParseToken(&data, false))
+                       if (!COM_ParseTokenConsole(&data))
                                break; // error
                        strcpy(value, com_token);
                        if (!strcmp("gridsize", key))
index 735ad7a..c8c1784 100644 (file)
@@ -2090,7 +2090,7 @@ void VM_parseentitydata(void)
        data = PRVM_G_STRING(OFS_PARM1);
 
     // parse the opening brace
-       if (!COM_ParseToken(&data, false) || com_token[0] != '{' )
+       if (!COM_ParseTokenConsole(&data) || com_token[0] != '{' )
                PRVM_ERROR ("VM_parseentitydata: %s: Couldn't parse entity data:\n%s", PRVM_NAME, data );
 
        PRVM_ED_ParseEdict (data, ent);
index 68f5197..747e33c 100644 (file)
@@ -843,7 +843,7 @@ void PRVM_ED_ParseGlobals (const char *data)
        while (1)
        {
                // parse key
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
                if (com_token[0] == '}')
                        break;
@@ -851,7 +851,7 @@ void PRVM_ED_ParseGlobals (const char *data)
                strcpy (keyname, com_token);
 
                // parse value
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
 
                if (com_token[0] == '}')
@@ -1036,7 +1036,7 @@ const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent)
        while (1)
        {
        // parse key
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
                if (developer_entityparsing.integer)
                        Con_Printf("Key: \"%s\"", com_token);
@@ -1068,7 +1068,7 @@ const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent)
                }
 
        // parse value
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
                if (developer_entityparsing.integer)
                        Con_Printf(" \"%s\"\n", com_token);
@@ -1143,7 +1143,7 @@ void PRVM_ED_LoadFromFile (const char *data)
        while (1)
        {
 // parse the opening brace
-               if (!COM_ParseToken(&data, false))
+               if (!COM_ParseTokenConsole(&data))
                        break;
                if (com_token[0] != '{')
                        PRVM_ERROR ("PRVM_ED_LoadFromFile: %s: found %s when expecting {", PRVM_NAME, com_token);
index 2c384f3..9f83ce6 100644 (file)
@@ -2927,7 +2927,7 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
                data = r_refdef.worldmodel->brush.entities;
        if (!data)
                return;
-       for (entnum = 0;COM_ParseToken(&data, false) && com_token[0] == '{';entnum++)
+       for (entnum = 0;COM_ParseTokenConsole(&data) && com_token[0] == '{';entnum++)
        {
                type = LIGHTTYPE_MINUSX;
                origin[0] = origin[1] = origin[2] = 0;
@@ -2945,7 +2945,7 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
                islight = false;
                while (1)
                {
-                       if (!COM_ParseToken(&data, false))
+                       if (!COM_ParseTokenConsole(&data))
                                break; // error
                        if (com_token[0] == '}')
                                break; // end of entity
@@ -2955,7 +2955,7 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
                                strcpy(key, com_token);
                        while (key[strlen(key)-1] == ' ') // remove trailing spaces
                                key[strlen(key)-1] = 0;
-                       if (!COM_ParseToken(&data, false))
+                       if (!COM_ParseTokenConsole(&data))
                                break; // error
                        strcpy(value, com_token);