diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 7fc3ba455..6a73f762d 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1237,10 +1237,12 @@ pr_debug_entity_view (qfot_type_t *type, pr_type_t *value, void *_data) if (pr->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); + if (edict) { + dasprintf (dstr, "entity %d", NUM_FOR_BAD_EDICT (pr, edict)); + return; + } } + dasprintf (dstr, "entity [%x]", value->entity_var); } static void