fix classname field finding

This commit is contained in:
Bill Currie 2001-02-28 23:33:16 +00:00
parent 63b990cd30
commit cc43c91c89

View file

@ -858,6 +858,7 @@ ED_LoadFromFile (progs_t * pr, char *data)
int inhibit; int inhibit;
dfunction_t *func; dfunction_t *func;
eval_t *classname; eval_t *classname;
ddef_t *def;
ent = NULL; ent = NULL;
inhibit = 0; inhibit = 0;
@ -888,13 +889,14 @@ ED_LoadFromFile (progs_t * pr, char *data)
// //
// immediately call spawn function // immediately call spawn function
// //
classname = GETEDICTFIELDVALUE (ent, FindFieldOffset (pr, "classname")); def = ED_FindField (pr, "classname");
if (classname) { if (!def) {
Con_Printf ("No classname for:\n"); Con_Printf ("No classname for:\n");
ED_Print (pr, ent); ED_Print (pr, ent);
ED_Free (pr, ent); ED_Free (pr, ent);
continue; continue;
} }
classname = (eval_t*)&ent->v[def->ofs];
// look for the spawn function // look for the spawn function
func = ED_FindFunction (pr, PR_GetString (pr, classname->string)); func = ED_FindFunction (pr, PR_GetString (pr, classname->string));