diff --git a/include/QF/progs.h b/include/QF/progs.h index 673176414..7c8bb3341 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -247,7 +247,7 @@ struct plitem_s *ED_EntityDict (progs_t *pr, edict_t *ed); struct plitem_s *ED_GlobalsDict (progs_t *pr); void ED_InitGlobals (progs_t *pr, struct plitem_s *globals); void ED_InitEntity (progs_t *pr, struct plitem_s *entity, edict_t *ent); -struct plitem_s *ED_ConvertToPlist (struct script_s *script); +struct plitem_s *ED_ConvertToPlist (struct script_s *script, int nohack); struct plitem_s *ED_Parse (progs_t *pr, const char *data); void ED_LoadFromFile (progs_t *pr, const char *data); void ED_EntityParseFunction (progs_t *pr); diff --git a/libs/gamecode/pr_parse.c b/libs/gamecode/pr_parse.c index 69cc71958..758e2c4cc 100644 --- a/libs/gamecode/pr_parse.c +++ b/libs/gamecode/pr_parse.c @@ -299,7 +299,7 @@ ED_ParseEpair (progs_t *pr, pr_type_t *base, ddef_t *key, const char *s) */ VISIBLE plitem_t * -ED_ConvertToPlist (script_t *script) +ED_ConvertToPlist (script_t *script, int nohack) { plitem_t *plist = PL_NewArray (); plitem_t *ent; @@ -320,10 +320,10 @@ ED_ConvertToPlist (script_t *script) if (strequal (token, "}")) break; anglehack = 0; - if (strequal (token, "angle")) { + if (!nohack && strequal (token, "angle")) { key = PL_NewString ("angles"); anglehack = 1; - } else if (strequal (token, "light")) { + } else if (!nohack && strequal (token, "light")) { key = PL_NewString ("light_lev"); } else { key = PL_NewString (token); @@ -501,7 +501,7 @@ ED_Parse (progs_t *pr, const char *data) } else { // oldstyle entity data Script_UngetToken (script); - entity_list = ED_ConvertToPlist (script); + entity_list = ED_ConvertToPlist (script, 0); } } Script_Delete (script); diff --git a/nq/source/host_cmd.c b/nq/source/host_cmd.c index f1731e844..4a819d66c 100644 --- a/nq/source/host_cmd.c +++ b/nq/source/host_cmd.c @@ -499,7 +499,7 @@ convert_to_game_dict (script_t *script) PL_D_AddObject (game, "lightstyles", item); // load the edicts out of the savegame file - list = ED_ConvertToPlist (script); + list = ED_ConvertToPlist (script, 0); item = PL_RemoveObjectAtIndex (list, 0); PL_D_AddObject (game, "globals", item); PL_D_AddObject (game, "entities", list); diff --git a/tools/qflight/source/entities.c b/tools/qflight/source/entities.c index 291f7915b..db8290c65 100644 --- a/tools/qflight/source/entities.c +++ b/tools/qflight/source/entities.c @@ -179,7 +179,7 @@ LoadEntities (void) script = Script_New (); Script_Start (script, "ent data", bsp->entdata); - entity_list = ED_ConvertToPlist (script); + entity_list = ED_ConvertToPlist (script, 1); Script_Delete (script); // start parsing