void PRVM_PrintFunctionStatements(prvm_prog_t *prog, const char *name);
void PRVM_ED_Print(prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname);
void PRVM_ED_Write(prvm_prog_t *prog, struct qfile_s *f, prvm_edict_t *ed);
-const char *PRVM_ED_ParseEdict(prvm_prog_t *prog, const char *data, prvm_edict_t *ent);
+const char *PRVM_ED_ParseEdict(prvm_prog_t *prog, const char *data, prvm_edict_t *ent, qbool saveload);
void PRVM_ED_WriteGlobals(prvm_prog_t *prog, struct qfile_s *f);
void PRVM_ED_ParseGlobals(prvm_prog_t *prog, const char *data);
if (!COM_ParseToken_Simple(&data, false, false, true) || com_token[0] != '{' )
prog->error_cmd("VM_parseentitydata: %s: Couldn't parse entity data:\n%s", prog->name, data );
- PRVM_ED_ParseEdict (prog, data, ent);
+ PRVM_ED_ParseEdict (prog, data, ent, false);
}
/*
Used for initial level load and for savegames.
====================
*/
-const char *PRVM_ED_ParseEdict (prvm_prog_t *prog, const char *data, prvm_edict_t *ent)
+const char *PRVM_ED_ParseEdict (prvm_prog_t *prog, const char *data, prvm_edict_t *ent, qbool saveload)
{
mdef_t *key;
qbool anglehack;
}
// parse value
- if (!COM_ParseToken_Simple(&data, false, false, true))
+ // If loading a save, unescape characters (they're escaped when saving).
+ // Otherwise, load them as they are (BSP compilers don't support escaping).
+ if (!COM_ParseToken_Simple(&data, false, saveload, true))
prog->error_cmd("PRVM_ED_ParseEdict: EOF without closing brace");
if (developer_entityparsing.integer)
Con_Printf(" \"%s\"\n", com_token);
dpsnprintf (com_token, sizeof(com_token), "0 %s 0", temp);
}
- if (!PRVM_ED_ParseEpair(prog, ent, key, com_token, strcmp(keyname, "wad") != 0))
+ if (!PRVM_ED_ParseEpair(prog, ent, key, com_token, false))
prog->error_cmd("PRVM_ED_ParseEdict: parse error");
}
if (ent != prog->edicts) // hack
memset (ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
- data = PRVM_ED_ParseEdict (prog, data, ent);
+ data = PRVM_ED_ParseEdict (prog, data, ent, false);
parsed++;
// remove the entity ?
if(developer_entityparsing.integer)
Con_Printf("SV_Loadgame_f: loading edict %d\n", entnum);
- PRVM_ED_ParseEdict (prog, start, ent);
+ PRVM_ED_ParseEdict (prog, start, ent, true);
// link it into the bsp tree
if (!ent->free)