From a069fad41ea87366243f19c45cf3f7b761b3dfa2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 13 Mar 2020 20:16:06 +0900 Subject: [PATCH] [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. --- libs/gamecode/pr_debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 0b76cb997..9464c326c 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -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