From 5b8345eecb45b2e63a2c6d738a3302b037cadb12 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 7 Mar 2011 08:28:20 +0900 Subject: [PATCH] Do not try to print values from null entities. --- libs/gamecode/engine/pr_debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/gamecode/engine/pr_debug.c b/libs/gamecode/engine/pr_debug.c index a8d208ac3..3c50a51db 100644 --- a/libs/gamecode/engine/pr_debug.c +++ b/libs/gamecode/engine/pr_debug.c @@ -900,7 +900,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) break; case 'E': { - edict_t *ed; + edict_t *ed = 0; opval = pr->pr_globals[s->a].entity_var; parm_ind = pr->pr_globals[s->b].uinteger_var; if (parm_ind < pr->progs->entityfields @@ -908,7 +908,8 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) && opval < pr->pr_edictareasize) { ed = PROG_TO_EDICT (pr, opval); opval = &ed->v[parm_ind] - pr->pr_globals; - } else { + } + if (!ed) { str = "bad entity.field"; break; }