data = entdata;
if (!data)
return;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] != '{')
return; // error
while (1)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] == '}')
break; // end of worldspawn
strlcpy (key, com_token, sizeof (key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
strlcpy (value, com_token, sizeof (value));
if (!strcmp("sky", key))
argv[arrayindex][0] = 0;
for (;;)
{
- if (!COM_ParseToken_Simple(&text, true))
+ if (!COM_ParseToken_Simple(&text, true, false))
return;
if (!strcmp(com_token, "\n"))
break;
Parse a token out of a string
==============
*/
-int COM_ParseToken_Simple(const char **datapointer, int returnnewline)
+int COM_ParseToken_Simple(const char **datapointer, qboolean returnnewline, qboolean parsebackslash)
{
int len;
int c;
for (data++;*data && *data != '\"';data++)
{
c = *data;
- if (*data == '\\')
+ if (*data == '\\' && parsebackslash)
{
data++;
c = *data;
Parse a token out of a string
==============
*/
-int COM_ParseToken_QuakeC(const char **datapointer, int returnnewline)
+int COM_ParseToken_QuakeC(const char **datapointer, qboolean returnnewline)
{
int len;
int c;
Parse a token out of a string
==============
*/
-int COM_ParseToken_VM_Tokenize(const char **datapointer, int returnnewline)
+int COM_ParseToken_VM_Tokenize(const char **datapointer, qboolean returnnewline)
{
int len;
int c;
extern char com_token[MAX_INPUTLINE];
-int COM_ParseToken_Simple(const char **datapointer, int returnnewline);
-int COM_ParseToken_QuakeC(const char **datapointer, int returnnewline);
-int COM_ParseToken_VM_Tokenize(const char **datapointer, int returnnewline);
+int COM_ParseToken_Simple(const char **datapointer, qboolean returnnewline, qboolean parsebackslash);
+int COM_ParseToken_QuakeC(const char **datapointer, qboolean returnnewline);
+int COM_ParseToken_VM_Tokenize(const char **datapointer, qboolean returnnewline);
int COM_ParseToken_Console(const char **datapointer);
extern int com_argc;
for (;;)
{
int l;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break;
if (com_token[0] == '{')
continue;
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_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break;
if (developer.integer >= 100)
Con_Printf("key: %s %s\n", keyname, com_token);
}
// version
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
version = atoi(com_token);
if (version != SAVEGAME_VERSION)
{
}
// description
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
for (i = 0;i < NUM_SPAWN_PARMS;i++)
{
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
spawn_parms[i] = atof(com_token);
}
// skill
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
// 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_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
strlcpy (mapname, com_token, sizeof(mapname));
// time
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
time = atof(com_token);
allowcheats = sv_cheats.integer != 0;
{
// light style
oldt = t;
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
// 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] == '{')
for(;;)
{
oldt = t;
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
if (com_token[0] == '{')
{
t = oldt;
for (;;)
{
start = t;
- while (COM_ParseToken_Simple(&t, false))
+ while (COM_ParseToken_Simple(&t, false, false))
if (!strcmp(com_token, "}"))
break;
- if (!COM_ParseToken_Simple(&start, false))
+ if (!COM_ParseToken_Simple(&start, false, false))
{
// end of file
break;
if (Cmd_Argc() > 2)
{
message = Cmd_Args();
- COM_ParseToken_Simple(&message, false);
+ COM_ParseToken_Simple(&message, false, false);
if (byNumber)
{
message++; // skip the #
}
p = sv_curl_serverpackages.string;
Con_DPrintf("Require all of: %s\n", p);
- while(COM_ParseToken_Simple(&p, false))
+ while(COM_ParseToken_Simple(&p, false, false))
{
Con_DPrintf("Require: %s\n", com_token);
Curl_RequireFile(com_token);
buf[sizeof(buf) - 1] = 0;
t = buf;
// version
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
version = atoi(com_token);
// description
- COM_ParseToken_Simple(&t, false);
+ COM_ParseToken_Simple(&t, false, false);
strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
// change _ back to space
int i, j, k;
if (!data)
return;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] != '{')
return; // error
while (1)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] == '}')
break; // end of worldspawn
strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
dpsnprintf(value, sizeof(value), "%s", com_token);
if (!strcmp("wad", key)) // for HalfLife maps
if (!maptext)
return;
text = maptext;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
submodel = 0;
for (;;)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break;
if (com_token[0] != '{')
return; // error
brushes = Mem_Alloc(loadmodel->mempool, maxbrushes * sizeof(mbrush_t));
for (;;)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] == '}')
break; // end of entity
}
for (;;)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
return; // error
if (com_token[0] == '}')
break; // end of brush
// FIXME: support hl .map format
for (pointnum = 0;pointnum < 3;pointnum++)
{
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
for (componentnum = 0;componentnum < 3;componentnum++)
{
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
point[pointnum][componentnum] = atof(com_token);
}
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
}
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
strlcpy(facetexture, com_token, sizeof(facetexture));
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
//scroll_s = atof(com_token);
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
//scroll_t = atof(com_token);
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
//rotate = atof(com_token);
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
//scale_s = atof(com_token);
- COM_ParseToken_Simple(&data, false);
+ COM_ParseToken_Simple(&data, false, false);
//scale_t = atof(com_token);
TriangleNormal(point[0], point[1], point[2], planenormal);
VectorNormalizeDouble(planenormal);
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_Simple(&data, false) && com_token[0] == '{')
+ if (data && COM_ParseToken_Simple(&data, false, false) && com_token[0] == '{')
{
while (1)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break; // error
if (com_token[0] == '}')
break; // end of worldspawn
strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break; // error
strlcpy(value, com_token, sizeof(value));
if (!strcmp("gridsize", key))
data = PRVM_G_STRING(OFS_PARM1);
// parse the opening brace
- if (!COM_ParseToken_Simple(&data, false) || com_token[0] != '{' )
+ if (!COM_ParseToken_Simple(&data, false, false) || com_token[0] != '{' )
PRVM_ERROR ("VM_parseentitydata: %s: Couldn't parse entity data:\n%s", PRVM_NAME, data );
PRVM_ED_ParseEdict (data, ent);
while (1)
{
// parse key
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
if (com_token[0] == '}')
break;
strlcpy (keyname, com_token, sizeof(keyname));
// parse value
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, true))
PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
if (com_token[0] == '}')
while (1)
{
// parse key
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
if (developer_entityparsing.integer)
Con_Printf("Key: \"%s\"", com_token);
}
// parse value
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, true))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
if (developer_entityparsing.integer)
Con_Printf(" \"%s\"\n", com_token);
while (1)
{
// parse the opening brace
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break;
if (com_token[0] != '{')
PRVM_ERROR ("PRVM_ED_LoadFromFile: %s: found %s when expecting {", PRVM_NAME, com_token);
data = r_refdef.worldmodel->brush.entities;
if (!data)
return;
- for (entnum = 0;COM_ParseToken_Simple(&data, false) && com_token[0] == '{';entnum++)
+ for (entnum = 0;COM_ParseToken_Simple(&data, false, false) && com_token[0] == '{';entnum++)
{
type = LIGHTTYPE_MINUSX;
origin[0] = origin[1] = origin[2] = 0;
islight = false;
while (1)
{
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break; // error
if (com_token[0] == '}')
break; // end of entity
strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
- if (!COM_ParseToken_Simple(&data, false))
+ if (!COM_ParseToken_Simple(&data, false, false))
break; // error
strlcpy(value, com_token, sizeof(value));
argc = 0;
for (;;)
{
- if (!COM_ParseToken_Simple(&text, true) || !strcmp(com_token, "\n"))
+ if (!COM_ParseToken_Simple(&text, true, false) || !strcmp(com_token, "\n"))
break;
if (argc < 16)
{