diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 9d8469185..a7389f54a 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -229,6 +229,14 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f) PR_PushFrame (pr); + //Sys_Printf("%s:\n", PR_GetString(pr,f->name)); + pr->pr_xfunction = f; + pr->pr_xstatement = f->first_statement - 1; // offset the st++ + + if (!f->locals) { + return; + } + if (f->numparms > 0) { paramofs = f->parm_start; for (i = 0; i < f->numparms; i++) { @@ -267,10 +275,6 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f) } } - //Sys_Printf("%s:\n", PR_GetString(pr,f->name)); - pr->pr_xfunction = f; - pr->pr_xstatement = f->first_statement - 1; // offset the st++ - // save off any locals that the new function steps on if (pr->localstack_used + f->locals > PR_LOCAL_STACK_SIZE) PR_RunError (pr, "PR_EnterFunction: locals stack overflow");