From: havoc Date: Fri, 7 Jul 2006 04:19:55 +0000 (+0000) Subject: changed most COM_ParseToken calls to COM_ParseTokenConsole, this fixed the kills... X-Git-Tag: xonotic-v0.1.0preview~3878 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=d5979b15410a801c2307b5bbfb3ca4279938a199;p=xonotic%2Fdarkplaces.git changed most COM_ParseToken calls to COM_ParseTokenConsole, this fixed the kills listing in the savegame menu git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6502 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index ae542bae..e9ef9b46 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -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)) diff --git a/console.c b/console.c index e68ca4fa..c244706d 100644 --- 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); diff --git a/host_cmd.c b/host_cmd.c index 5f1569aa..ebfd6d49 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -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 abc4a748..66f228c8 100644 --- 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 diff --git a/model_brush.c b/model_brush.c index 937924f5..32c49f6e 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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)) diff --git a/prvm_cmds.c b/prvm_cmds.c index 735ad7a2..c8c17849 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -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); diff --git a/prvm_edict.c b/prvm_edict.c index 68f5197a..747e33c7 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -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); diff --git a/r_shadow.c b/r_shadow.c index 2c384f33..9f83ce63 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -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);