[gamecode] Print only entity address when no edicts

If the edicts pointer is null, it's not possible to convert the entity
address to an index.
This commit is contained in:
Bill Currie 2020-03-13 20:16:06 +09:00
parent f738639d68
commit a069fad41e
1 changed files with 6 additions and 2 deletions

View File

@ -1019,9 +1019,13 @@ pr_debug_entity_view (qfot_type_t *type, pr_type_t *value, void *_data)
__auto_type data = (pr_debug_data_t *) _data;
progs_t *pr = data->pr;
dstring_t *dstr = data->dstr;
edict_t *edict = PROG_TO_EDICT (pr, value->entity_var);
dasprintf (dstr, "entity %d", NUM_FOR_BAD_EDICT (pr, edict));
if (pr->edicts) {
edict_t *edict = PROG_TO_EDICT (pr, value->entity_var);
dasprintf (dstr, "entity %d", NUM_FOR_BAD_EDICT (pr, edict));
} else {
dasprintf (dstr, "entity [%x]",value->entity_var);
}
}
static void