From fe3b5445284109b8b37c8cba1de5d5b59d1c5c62 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 13 Aug 2003 17:27:34 +0000 Subject: [PATCH] handle "return 0" a bit better. assumes location is is always 0, but it always has been (and always /should/ be anyway:) --- libs/gamecode/engine/pr_exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/gamecode/engine/pr_exec.c b/libs/gamecode/engine/pr_exec.c index 8fa88e478..2f4ce27d9 100644 --- a/libs/gamecode/engine/pr_exec.c +++ b/libs/gamecode/engine/pr_exec.c @@ -690,7 +690,10 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum) break; case OP_DONE: case OP_RETURN: - if (&R_INT (pr) != &OPA.integer_var) + if (!st->a) + memset (&R_INT (pr), 0, + pr->pr_param_size * sizeof (OPA)); + else if (&R_INT (pr) != &OPA.integer_var) memcpy (&R_INT (pr), &OPA, pr->pr_param_size * sizeof (OPA)); PR_LeaveFunction (pr);