Make the angle and light hacks optional.

I'd forgotten that ED_ConvertToPlist mangled light into light_lev and
single component angle values into a vector. This fixes much of the
breakage in qflight (but not the light levels)
This commit is contained in:
Bill Currie 2012-12-30 19:54:45 +09:00
parent 26baa75a1b
commit 7c1d9d2b84
4 changed files with 7 additions and 7 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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